Hi, I'm trying to figure out why a particular library (ColorLCDShield) isn't working for my Mega2560 when another that was designed for the same LCD/Controllers (6100 with both Epson and Phillips controllers) works just fine.
I'm looking through the port definitions and see this:
#ifdef __AVR_ATmega1280__
//* Arduino Mega bit numbers
#define LCD_RES 5 // D8
#define LCD_CS 6 // D9
#define LCD_DIO 5 // D11
#define LCD_SCK 7 // D13
//* Arduino Mega ports
#define LCD_PORT_CS PORTH
#define LCD_PORT_SCK PORTB
#define LCD_PORT_RES PORTH
#define LCD_PORT_DIO PORTB
#else
//* Arduino Duemilanove bit numbers
#define LCD_RES 0 // D8
#define LCD_CS 1 // D9
#define LCD_DIO 3 // D11
#define LCD_SCK 5 // D13
//#define LCD_PORT PORTB
//* Arduino Duemilanove ports
#define LCD_PORT_CS PORTB
#define LCD_PORT_SCK PORTB
#define LCD_PORT_RES PORTB
#define LCD_PORT_DIO PORTB
#endif
Now, it is taking the Duemilanove definitions, which I have no idea if they are correct or not.
The numbers defined appear to be left shifts, like this:
DDRB = ((1<<LCD_CS)|(1<<LCD_DIO)|(1<<LCD_SCK)|(1<<LCD_RES));
Can anyone help? Or at least point me in the right direction?