Pages: [1]   Go Down
Author Topic: 2.4 tft lcd touch shield pin mapping for Arduino Mega 2560  (Read 1178 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a iteadstudio 2.4 tft touch shield that currently works with my Arduino Uno R3 board.
I now want to get this shield working on the Arduino Mega 2560 R3 board.
first up this shield is a little old,
the manufactures does state that the board does work with the Arduino Mega
link http://imall.iteadstudio.com/development-platform/im120417012.html

this is the code from my sketch

#include <UTFT.h>
#include <UTouch.h>


// Uncomment the next two lines for the Arduino Mega

//This is my attemp in trying to initialize shield
UTFT        myGLCD(ITDB24E_8, A5,A4,A3,A2);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch( A1, 10, A0, 8, 9); // original values 6,5,4,3,2);

// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];

void setup(void)
{
  /* Start Ethernet sheild */
  Ethernet.begin( mac,ip,subnet,gateway );
  delay( 100 );
 
  /* Initalize LCD screen */ 
  myGLCD.InitLCD( 1 );

  /* Clear LCD Screen */
  myGLCD.clrScr();
 
  //myGLCD.setColor(0, 255, 0);
  myGLCD.setBackColor( VGA_AQUA );
  myGLCD.setFont( BigFont );
 
  myTouch.InitTouch( 1 );
  myTouch.setPrecision(PREC_HI);
  drawLCD();
}

void loop(void)
{
 
 if( myTouch.dataAvailable() )
 {
   myTouch.read();
   x = myTouch.getX();
   y = myTouch.getY();
 
 
   if( ( y >= 15 ) && ( y <= 122 ) )
     {
       if( (x >= 2 ) && ( x <= 148 ) )
       {
         //waitForItTemp0(5,5,309,230);
         //backButtonTemp0();
       }
     }
   
   
}


* TftSheild6001.png (122.01 KB, 334x186 - viewed 49 times.)
Logged

Pages: [1]   Go Up
Jump to: