0

arduino ide tft gizmo arcada example not working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

arduino ide tft gizmo arcada example not working

by zorglub on Thu Apr 15, 2021 5:36 pm

Hello,

I was following the example of the arcade library for my TFT Gizmo, I do believe all the required dependent libraries are present and to the latest version but the example does not work.
I get no matching function for call to 'print(const char [24], char*&)'
Can someone tell me what I did wrong?
Arduino 1.8.13 on Windows 10
Code: Select all | TOGGLE FULL SIZE
In file included from sketch\imageloader_tft_gizmo.ino.cpp:1:0:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:55:0: warning: "digitalPinToInterrupt" redefined
 #define digitalPinToInterrupt(P)   ( P )
 
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:48:0,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\variants\circuitplay/variant.h:57:0: note: this is the location of the previous definition
 #define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)
 
In file included from C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Adafruit_Arcada.h:20:0,
                 from C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino:1:
C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Boards/Adafruit_Arcada_CircuitPlaygroundExpress.h: In member function 'virtual void Adafruit_Arcada::displayBegin()':
C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Boards/Adafruit_Arcada_CircuitPlaygroundExpress.h:5:24: error: 'SPI1' was not declared in this scope
 #define ARCADA_TFT_SPI SPI1
                        ^
C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Boards/Adafruit_Arcada_CircuitPlaygroundExpress.h:50:49: note: in expansion of macro 'ARCADA_TFT_SPI'
     Adafruit_ST7789 *tft = new Adafruit_ST7789(&ARCADA_TFT_SPI, ARCADA_TFT_CS,
                                                 ^~~~~~~~~~~~~~
C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Boards/Adafruit_Arcada_CircuitPlaygroundExpress.h:5:24: note: suggested alternative: 'SPI'
 #define ARCADA_TFT_SPI SPI1
                        ^
C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Arcada_Library/Boards/Adafruit_Arcada_CircuitPlaygroundExpress.h:50:49: note: in expansion of macro 'ARCADA_TFT_SPI'
     Adafruit_ST7789 *tft = new Adafruit_ST7789(&ARCADA_TFT_SPI, ARCADA_TFT_CS,
                                                 ^~~~~~~~~~~~~~
C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino: In function 'void loop()':
C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino:4:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 #define IMAGE_A "adabot.bmp"
                 ^
C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino:41:17: note: in expansion of macro 'IMAGE_A'
     imagefile = IMAGE_A;
                 ^~~~~~~
C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino:5:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 #define IMAGE_B "blinka.bmp"
                 ^
C:\Users\PWARIC~1\AppData\Local\Temp\arduino_modified_sketch_468302\imageloader_tft_gizmo.ino:45:17: note: in expansion of macro 'IMAGE_B'
     imagefile = IMAGE_B;
                 ^~~~~~~
imageloader_tft_gizmo:59:52: error: no matching function for call to 'print(const char [24], char*&)'
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:67:12: note: candidate: size_t arduino::Print::print(unsigned char, int) <near match>
     size_t print(unsigned char, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:67:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:68:12: note: candidate: size_t arduino::Print::print(int, int) <near match>
     size_t print(int, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:68:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:69:12: note: candidate: size_t arduino::Print::print(unsigned int, int) <near match>
     size_t print(unsigned int, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:69:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:70:12: note: candidate: size_t arduino::Print::print(long int, int) <near match>
     size_t print(long, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:70:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:71:12: note: candidate: size_t arduino::Print::print(long unsigned int, int) <near match>
     size_t print(unsigned long, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:71:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:72:12: note: candidate: size_t arduino::Print::print(long long int, int) <near match>
     size_t print(long long, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:72:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
In file included from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/ArduinoAPI.h:31:0,
                 from C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/Arduino.h:23,
                 from sketch\imageloader_tft_gizmo.ino.cpp:1:
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:73:12: note: candidate: size_t arduino::Print::print(long long unsigned int, int) <near match>
     size_t print(unsigned long long, int = DEC);
            ^~~~~
C:\Users\pwarichet\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:73:12: note:   conversion of argument 2 would be ill-formed:
imageloader_tft_gizmo:59:52: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   Serial.print("Loading %s to screen...", imagefile);
                                                    ^
Multiple libraries were found for "Adafruit_CircuitPlayground.h"
 Used: C:\Users\pwarichet\Documents\Arduino\libraries\Adafruit_Circuit_Playground
 Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\Adafruit_Circuit_Playground
exit status 1
no matching function for call to 'print(const char [24], char*&)'
Last edited by adafruit_support_carter on Thu Apr 15, 2021 7:23 pm, edited 1 time in total.
Reason: added [code] tags
zorglub
 
Posts: 4
Joined: Thu Mar 27, 2014 7:54 pm

Re: arduino ide tft gizmo arcada example not working

by adafruit_support_carter on Thu Apr 15, 2021 7:28 pm

Did you install the libraries throught the Library Manager?

What board are you selecting under Tools -> Board?

adafruit_support_carter
 
Posts: 20386
Joined: Tue Nov 29, 2016 2:45 pm

Re: arduino ide tft gizmo arcada example not working

by zorglub on Thu Apr 15, 2021 7:47 pm

Yes as far as I know the libraries were installed with the library manager of the IDE and the board is set to
Arduino SAMD(32-Bits ARM Cortex-M0+ Boards) -> Adafruit Playground Express
zorglub
 
Posts: 4
Joined: Thu Mar 27, 2014 7:54 pm

Re: arduino ide tft gizmo arcada example not working

by adafruit_support_carter on Thu Apr 15, 2021 8:23 pm

OK, I'm seeing the same thing when building for that board. The Circuit Playground Express is a little unique in that it shows up in both the Arduino SAMD Board Support Package and the Adafruit SAMD Board Support Packages. The one from the Adafruit BSP compiles OK.

To install the Adafruit SAMD BSP see here for adding the URL:
https://learn.adafruit.com/add-boards-a ... v164/setup
and here for installing:
https://learn.adafruit.com/adafruit-fea ... -2854160-7

Once that's done, pick Tools -> Boards -> Adafruit SAMD -> Adafruit Circuit Playground Express

adafruit_support_carter
 
Posts: 20386
Joined: Tue Nov 29, 2016 2:45 pm

Re: arduino ide tft gizmo arcada example not working

by zorglub on Fri Apr 16, 2021 1:19 am

Thank you so much for this! I really appreciate the help.

Now it compiles indeed, I missed the step to install the board. but it does not execute, it is actually quite strange everything go fine but then the playground seral port disappear from windows and it complains that the device is malfunctioning. The output from the IDE is as follow:

Sketch uses 92304 bytes (35%) of program storage space. Maximum is 262144 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v1.1 [Arduino:XYZ] Feb 21 2021 21:09:52
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.858 seconds

Write 93068 bytes to flash (1455 pages)
[==============================] 100% (1455/1455 pages)
done in 0.678 seconds

Verify 93068 bytes of flash with checksum.
Verify successful
done in 0.150 seconds
CPU reset.
processing.app.SerialException: Error opening serial port 'COM27'.
at processing.app.Serial.<init>(Serial.java:152)
at processing.app.Serial.<init>(Serial.java:82)
at processing.app.SerialMonitor$2.<init>(SerialMonitor.java:132)
at processing.app.SerialMonitor.open(SerialMonitor.java:132)
at processing.app.AbstractMonitor.resume(AbstractMonitor.java:132)
at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2120)
at processing.app.Editor.access$1300(Editor.java:117)
at processing.app.Editor$UploadHandler.run(Editor.java:2089)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM27; Method name - openPort(); Exception type - Port not found.
at jssc.SerialPort.openPort(SerialPort.java:167)
at processing.app.Serial.<init>(Serial.java:141)
... 8 more
Error opening serial port 'COM27'.
zorglub
 
Posts: 4
Joined: Thu Mar 27, 2014 7:54 pm

Re: arduino ide tft gizmo arcada example not working

by zorglub on Fri Apr 16, 2021 1:28 pm

Got it to work I had to do 2 modifications. The main one was to comment on the following lines:

Code: Select all | TOGGLE FULL SIZE
void setup(void) {
  arcada.arcadaBegin();
   while (1);
  }


Calling "arcada.arcadaBegin()" reset the USB connection and the Playground express does not come back, commenting these 2 lines fixed the first issue.
The second issue was that the buttons were not working so I change it to use the circuitPlayground library.

Code: Select all | TOGGLE FULL SIZE
void loop() {
  leftButtonPressed = CircuitPlayground.leftButton();
  rightButtonPressed = CircuitPlayground.rightButton();
  char *imagefile = 0;
  //arcada.readButtons();
  //uint8_t buttons = arcada.justPressedButtons();
  //Serial.print("Pressed: ");
  //if (buttons & ARCADA_BUTTONMASK_LEFT) {
  if (leftButtonPressed) {
    Serial.print("LEFT");
    imagefile = IMAGE_A;
    Serial.print("< ");
  }
  if (rightButtonPressed) {
    Serial.print("RIGHT");
    imagefile = IMAGE_B;
    Serial.print("> ");
  }
  Serial.println();
zorglub
 
Posts: 4
Joined: Thu Mar 27, 2014 7:54 pm

Re: arduino ide tft gizmo arcada example not working

by adafruit_support_carter on Mon Apr 19, 2021 11:07 am

Calling "arcada.arcadaBegin()" reset the USB connection and the Playground express does not come back, commenting these 2 lines fixed the first issue.

I wonder if you were running into this?
https://github.com/adafruit/Adafruit_Arcada/issues/33

adafruit_support_carter
 
Posts: 20386
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.