Unable to compile sketch - Mega2560/Adafruit 2.8" TFT

I apologize if this isn't the correct area to ask for assistance with this issue; for some reason I do not have the option to post a new topic in the Display sub. Mods feel free to move if so.

I'm using the Adafruit 2.8" TFT shield as noted in the subject line and connecting to a Mega2560. The Adafruit_TFT_h library required for my sketch includes the following note:

// **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. ****
// **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED:             ****

//#define USE_ADAFRUIT_SHIELD_PINOUT 1

I uncommented this line as instructed by the notes in the header for the library, but when I do, I get a substantial list of errors that when copied into a word processor literally runs to 608 pages. If I leave this line commented out, the sketch compiles with no issues but obviously that leaves me with a non-functional sketch (the backlight comes on but nothing appears on the display). I'm new to Arduino so I'm unsure how to proceed resolving this, but I'm perplexed that following the instructions in the library header for my equipment results in such substantial errors.

Read this before posting a programming question

You are likely to not receive helpful responses without posting your code.
Also, that many errors tells me that you have a basic mistake.
Post your code and the first page of errors.

I'm unable to include the code here as it runs over the character limit, but here is a pastebin link:
Slider control code
This is the first page of errors:
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp:815:0: warning: "read8" redefined
#define read8(x) x=read8fn()

In file included from /home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp:23:0:
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/pin_magic_MEGA.h:91:0: note: this is the location of the previous definition
#define read8 read8inline

/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::init()':
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/pin_magic_MEGA.h:105:18: error: 'csPort' was not declared in this scope
#define CS_IDLE *csPort |= csPinSet
^
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp:106:3: note: in expansion of macro 'CS_IDLE'
CS_IDLE; // Set all control bits to idle state
^~~~~~~
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/pin_magic_MEGA.h:105:18: note: suggested alternative: 'qsort'
#define CS_IDLE *csPort |= csPinSet
^
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp:106:3: note: in expansion of macro 'CS_IDLE'
CS_IDLE; // Set all control bits to idle state
^~~~~~~
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/pin_magic_MEGA.h:105:28: error: 'csPinSet' was not declared in this scope
#define CS_IDLE *csPort |= csPinSet
^
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.cpp:106:3: note: in expansion of macro 'CS_IDLE'
CS_IDLE; // Set all control bits to idle state
^~~~~~~
/home/lumbergh/Arduino/libraries/Adafruit_TFTLCD/pin_magic_MEGA.h:105:28: note: suggested alternative: 'isPunct'
#define CS_IDLE *csPort |= csPinSet

Thank you for taking the time.
p { margin-bottom: 0.1in; line-height: 115%; background: transparent }p { margin-bottom: 0.1in; line-height: 115%; background: transparent }

Was un-commenting that one line the only change you made? I do not have any errors when I un-comment the line and compile for the Mega, although there are warning messages either way. Are your libraries up to date?

david_2018:
Was un-commenting that one line the only change you made? I do not have any errors when I un-comment the line and compile for the Mega, although there are warning messages either way. Are your libraries up to date?

Yes, that was it. :o

AFAIK all the libraries are up to date, I generally run updates before trying to compile.

These displays use 8-bit parallel to communicate, 12 or 13 pins are required to interface (RST is optional).

Is this an 8 bit parallel display you are using? Adafruit_TFTLCD.cpp From what I recall, is a pretty old library.

-jim lee

jimLee:
Is this an 8 bit parallel display you are using? Adafruit_TFTLCD.cpp From what I recall, is a pretty old library.

-jim lee

It can work in either 8-bit or SPI mode.

Your library is for an 8 bit display. Check where you bought it and see what they call for as a library. I fear you have the wrong set.

-jim lee

I've tried compiling and running "graphicstest," which is a sample sketch included in the Adafruit library for testing. It returned the following error:

error: no members matching 'Adafruit_GFX::drawRGBBitmap' in 'class Adafruit_GFX'

This is getting pretty frustrating, especially since some of you have been able to compile the original code that brought me here without issue.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.