Sain Smart 3.2 LCD Touch...

Noob here. Recently migrated over from Parallax. Please bear with my learning curve :slight_smile:

Purchased a Sain Smart 3.2 LCD with Arduino LCD Shield and (originally) and Uno. All my reading suggested that the Uno was really under powered for the screen if I wanted to use the touch functionality (which I do), so I purchased a Due and hooked it all up.

I installed the libraries UTFT and UTouch, per Sain Smart’s instructions, downloaded/installed the Due Board via the Boards Manager in the Arduino IDE 1.6.4. No problems.

Opened the example code and tried to compile and upload, not really expecting it to work, as I figured I would have to update pin locations and such. However, I was confused by the following error messages:

Arduino: 1.6.4 (Windows 7), Board: “Arduino Due (Native USB Port)”

Arduino: 1.6.4 (Windows 7), Board: “Arduino Due (Native USB Port)”

Build options changed, rebuilding all

Using library UTouch in folder: C:\Program Files (x86)\Arduino\libraries\UTouch (legacy)

Using library UTFT in folder: C:\Program Files (x86)\Arduino\libraries\UTFT (legacy)

C:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=10604 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER=“Unknown” -DUSB_PRODUCT=“Arduino Due” -IC:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\system/libsam -IC:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\system/CMSIS/CMSIS/Include/ -IC:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\system/CMSIS/Device/ATMEL/ -IC:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\cores\arduino -IC:\Users\ppillard\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\variants\arduino_due_x -IC:\Program Files (x86)\Arduino\libraries\UTouch -IC:\Program Files (x86)\Arduino\libraries\UTFT C:\Users\ppillard\AppData\Local\Temp\build6637309728449377614.tmp\PerryTestLCDTouch.cpp -o C:\Users\ppillard\AppData\Local\Temp\build6637309728449377614.tmp\PerryTestLCDTouch.cpp.o

UTouch_Calibration.ino: In function ‘void setup()’:
UTouch_Calibration.ino:63:6: error: redefinition of ‘void setup()’
PerryTestLCDTouch.ino:7:6: error: ‘void setup()’ previously defined here
UTouch_Calibration.ino: In function ‘void loop()’:
UTouch_Calibration.ino:291:6: error: redefinition of ‘void loop()’
PerryTestLCDTouch.ino:12:6: error: ‘void loop()’ previously defined here
redefinition of ‘void setup()’

To mine unskilled eye, she seems to be puking at multiple declarations of ‘void blah’ in both the libraries and my code file.

Please advise! And thanks for any help

TTT. Surely someone has this thing running with the Due?

ppillard:
Purchased a Sain Smart 3.2 LCD with Arduino LCD Shield and (originally) and Uno. All my reading suggested that the Uno was really under powered for the screen if I wanted to use the touch functionality (which I do), so I purchased a Due and hooked it all up.

Note: The Arduino UNO runs at 5V. The DUE runs at 3.3V max. The shields are not compatible. If you are using the UNO shield on the DUE , you can seriously damage the DUE board.

Otherwise, make sure your communication port and board type are selected properly. Without any shields or anything else, connected to the DUE, Load and run the blenk sketch. Make sure the DUE and programming connection works properly, Before you go any further.

if you have a problem loading the sketch, try a different USB cable. Also you can try the other USB port.

That is good to know, thank you. I will certainly address that. However, right now I can't even get this code to pass syntax check.

Unfortunately, without seeing your code, there is no way that anyone can debug it for you. A typographical error (misspelled word or a punctuation that has been left out or in the wrong place), or a declaration that has been left out, All can cause your code to crash. We also need to see the error messages as they appeared.

Even if your code is correct,the order of execution is very important. In some cases,placing a line of code in the wrong place can cause an error that can be difficult to track down.

Your error may not be on the line number indicated by the compiler. Without seeing your code, my best suggestion is to, check your spelling. Every line, every word, from start to finish. make sure all punctuation " ( , ) , ; . Etc. " is in place. Make sure all " include" statements are properly assigned, And all variables are declared before they are needed.

if all else fails, post your code. At least the main part, that seems to be giving the trouble.

OK, I got it to compile and even uploaded it to the Due with no problems. I had inadvertently included a file that loaded the UTFT and UTouch libraries in addition to the stock code from SainSmart (thus a double reference). I do, however have the wrong LCD and shield for the Due.

I purposely did not include the source code because I was using (or so I thought) the stock example code from SainSmart, and I was curious if anyone else had similar issues.

Likely, I have dove into the deep end without enough dog-paddling around in the shallow, but it's just too soon to quit, as I clearly have yet to drown.