Pages: [1]   Go Down
Author Topic: 2.8" TFT interface with atmega328  (Read 1325 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys I am a newbie to Arduino and I am trying to interface my Arduino Duemilanove Atmega328p DEVELOPMENTAL BOARD with 2.8" TFT touch screen. I am trying to compile the basic code for touch screen "graphicstest" but I am getting the below mentioned error. HELP ME OUT!!!!!!!! smiley-roll-sweat


 from D:\Projects smiley-confuse\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\/Adafruit_TFTLCD.h:12,

                 from D:\Projects\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:10:

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

                 from D:\Projects\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\/Adafruit_TFTLCD.h:12,

                 from D:\Projects\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:10:

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

d:/projects/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So either post the code or send a link to it, only then can we see what is causing the errors.
Logged

China
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Just kidding.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you know,maybe your code is wrong.post your code,so we can find the mistakes where are they.
Logged

Just kidding.

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have downloaded the code from the link mentioned below.

http://www.ladyada.net/products/tfttouchbreakout/#connection_options

Once you go to the page there is a download option at the end of the page. I downloaded the Touch screen library, TFT LCD library and GFX library. Unzipped them and added them in my libraries folder. I compile them and the errors show up.

Download

Touch screen library
TFT LCD library
GFX library
Breakout board schematic
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I downloaded the Touch screen library, TFT LCD library and GFX library. Unzipped them and added them in my libraries folder.
Did you change the folder name to match the name of the .ccp file? You need to.

Quote
I compile them and the errors show up.
You don't compile libraries you include them in code you write. What code did you try and include them in? That is what we are missing.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just tried to compile some example files in those libraries and had no errors.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup I have changed the name of the folders. I am trying to work on the examples given in the Adafruit_TFTLCD folder. I have attached the  "graphicstest" example  snap shot.I cannot copy paste the entire code since it exceeds the number of character limit in the forum. I complied the program and I am getting the errors mentioned below. In the example the libraries have been called. What am I missing????
smiley-confuse

 from D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\/Adafruit_TFTLCD.h:12,

                 from D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:10:

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'

                 from D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\/Adafruit_TFTLCD.h:12,

                 from D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:10:

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

d:/projects/consultant/touch screen proj/arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::init()':

D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:134: error: 'A3' was not declared in this scope

D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:135: error: 'A2' was not declared in this scope

D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:136: error: 'A1' was not declared in this scope

D:\Projects\Consultant\Touch screen Proj\arduino-0018\libraries\Adafruit_TFTLCD\Adafruit_TFTLCD.cpp:137: error: 'A0' was not declared in this scope



* example.png (54.36 KB, 819x589 - viewed 20 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, you are using Arduino IDE version 0.18.
A lot has happened since then, this libary needs the latest arduino IDE or at least version 1.0.3
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes Mike ur rite....But my board is not getting connected to the PC with the latest version of the Audruino software. I am stuck in between, Can I wriggle out of this mess???
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well it might need new drivers. What exactly is the error message you get?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mike,
           I had bought a custom made arduino duemilanove board hence, it neva used to connect to the latest version of arduino UI (Ver 1.0.3). I have exchanged it for the original version of Arduino Uno board. Nw I am able to compile and dump the code to the board. Nw one prob solved I have a different prob trying to interface the touch screen LCD. I am trying to interface 3.2" TFT touch screen LCD (TFT_320QVT). I need the drivers for this touch screen.

Are there any codes available online for the board?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you seen this:-
http://www.circuitidea.com/Article/Using-Arduino-shield-BL-TFT240320PLUS.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi MIke,
           I did go through that link you posted. I am trying to display colours on the TFT LCD with code I have uploaded can u tel wher I am going wrong. Nothing displays on the LCD. smiley-confuse

* Code.txt (5.46 KB - downloaded 12 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

From what I can see you are using pins 0 and 1 and they are used for serial coms.
It is a very oddly written piece of code.
The problem I suspect is that you have not tested it and are trying to just big bang it and getting the result that nothing works.
Try testing each function separately.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mike,
            I took ur suggestion and programmed it step by step up. Eventually, I got it right. Thanks for the support. CHEERS!!!!! smiley-grin
Logged

Pages: [1]   Go Up
Jump to: