TFT FW issue on Arduino UNO R3

Hi,

I download the FW to Arduino UNO R3, there is some issue as below, how do I revolve it. thanks.

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/193621037/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/193621037/pinned -libraries /tmp/193621037/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1

Multiple libraries were found for "TFT.h"

Used: /home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2

Not used: /home/ubuntu/opt/libraries/latest/tft_1_0_5

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:51:29: error: no matching function for call to 'TFT::TFT(int, int, int)'

TFT TFTscreen = TFT(cs, dc, rst);

^

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:51:29: note: candidates are:

In file included from /tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:48:0:

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: TFT::TFT()

class TFT

^

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: candidate expects 0 arguments, 3 provided

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: constexpr TFT::TFT(const TFT&)

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: candidate expects 1 argument, 3 provided

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: constexpr TFT::TFT(TFT&&)

/home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2/TFT.h:150:7: note: candidate expects 1 argument, 3 provided

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino: In function 'void setup()':

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:65:13: error: 'class TFT' has no member named 'begin'

TFTscreen.begin();

^

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:68:13: error: 'class TFT' has no member named 'background'

TFTscreen.background(255, 255, 255);

^

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino: In function 'void setScreen(int)':

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:154:15: error: 'class TFT' has no member named 'fill'

TFTscreen.fill(redVal, greenVal, blueVal);

^

/tmp/193621037/TFTHRsimulator_AR_201608_extrapulse_V1.1/TFTHRsimulator_AR_201608_extrapulse_V1.1.ino:155:15: error: 'class TFT' has no member named 'rect'

TFTscreen.rect(55,39,50,50);

^

exit status 1

The problem is that the Arduino Web Editor has over 1400 libraries pre-installed and it so happens that two different libraries have a file named TFT.h. As you can see here:

stevezhang:
Multiple libraries were found for "TFT.h"

Used: /home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2

Not used: /home/ubuntu/opt/libraries/latest/tft_1_0_5

The one your code is written for is /home/ubuntu/opt/libraries/latest/tft_1_0_5 but the Arduino Web Editor chose to use /home/ubuntu/opt/libraries/latest/tft_touch_shield_v1_0_1_0_2 instead.

So the solution is to find a way to make the Arduino Web Editor prefer the library your code was written for. Luckily the Arduino Web Editor gives some preference to "Custom" libraries that you have uploaded over the pre-installed libraries. So you only need to do this:

  • Download https://github.com/arduino-libraries/TFT/archive/1.0.5.zip
  • (In the Arduino Web Editor) Click the "Libraries" tab on the left side of the screen.
  • Click the upload button (upward pointing arrow).
  • If you get a notice about importing your whole sketchbook, click the "Import" button.
  • Select the downloaded file
  • Click "Open"
  • Wait for the library to finish being uploaded to Arduino Web Editor

After that your sketch should compile successfully.

Thanks Pert. the issue was solved.