#yes
1 messages · Page 1 of 1 (latest)
is that "GPIO can only be used as input mode" message showing up after "Touch Paint!" gets printers in the serial monitor?
https://github.com/adafruit/Adafruit_ILI9341/blob/6aad711ce8cc5fb0fc39fc5a5c9b0b71bf410708/examples/breakouttouchpaint/breakouttouchpaint.ino#L57
try leaving the serial monitor open and then press reset on the feather
it's unclear what is printing that message
yes I get this "17:41:01.596 -> E (18927) gpio: GPIO can only be used as input mode
17:41:01.629 -> E (18983) gpio: GP��B����6�!� ��z5!ͥ!��Touch Paint!
17:41:03.636 -> E (755) gpio: GPIO can only be used as input mode
17:41:03.636 -> E (756) gpio: GPIO can only be used as input mode"
so it's showing "Touch Paint!" and then it prints that message
try adding another serial print after the call to tft.begin
Serial.println(F("Touch Paint!"));
tft.begin();
Serial.println("TFT initd!");
see if "TFT initd!" gets shown in serial monitor
I get this "17:46:09.177 -> E (4839) gpio: GPIO can only be used as input mode
17:46:09.209 -> E (4893) gpio: GPIO can only be usedh0�L�Χj1���z�=�e����Touch Paint!
17:46:10.331 -> TFT initd!
17:46:10.429 -> E (755) gpio: GPIO can only be used as input mode"
so I get TFT initd! aswell
but I still need to tap reset
have you tried the basic GFX example?
https://learn.adafruit.com/adafruit-2-4-color-tft-touchscreen-breakout/adafruit-gfx-library
just to make sure that one at least works?
the graphictest works
weird. what version of the arduino ide are you using?
2.2.1
try 1.8.19 and see if does same thing
im going to hook this hardware up and test as well.
ok. i've recreated it. it shows up in 1.8.19 also.
09:02:35.568 -> !⸮
09:02:35.568 -> ⸮ܟ
u⸮⸮⸮1⸮⸮⸮1!⸮⸮⸮⸮y⸮⸮⸮Touch Paint!
09:02:36.462 -> E (735) gpio: GPIO can only be used as input mode
09:02:36.496 -> E (736) gpio: GPIO can only be used as input mode
09:02:36.562 -> E (737) gpio: GPIO can only be used as input mode
09:02:36.628 -> E (761) gpio: GPIO can only be used as input mode
and just keeps printing the gpio message
yup that is the same error I get
ok, will need to look at this a bit...
but I could not recreate it using 1.8.19 since it does not find the usb port
couldnt they just set the pin as an output in their code since esp32 have reconfigurable pins ?
ie: pinMode(GPIO, OUTPUT);
could you guide me through it since I dont understand I am quite new
I used they because I want cater to validate if it's a good idea first
@cater imho this part should be tougher with defines for the board imho: . On the esp32 feather for instance there is no pin 0 as far as I can tell and it would print the gpio can only be used as an input mode since it's out of range. Doesnt seem to be the problem here since rst-pin should be passed as -1 as the way to it (https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_SPITFT.cpp) . This could cause other problems for other users down the line
part of the issue is the analog pins being used. some are input only:
https://learn.adafruit.com/adafruit-esp32-feather-v2/pinouts#bottom-row-3117386
so avoid using A2,A3,A4
haven't gotten it to fully work yet. can use A0,A1,A5 and it runs without the error message
but the actual touch readings do not look correct
looking into that now
i'm currently using this demo:
https://github.com/adafruit/Adafruit_TouchScreen/blob/master/examples/touchscreendemo/touchscreendemo.ino
with:
#define YP A0 // must be an analog pin, use "An" notation!
#define XM A1 // must be an analog pin, use "An" notation!
#define YM 32 // can be a digital pin
#define XP 12 // can be a digital pin
try running that same example and see what values you get for the various readings
comment out the conditional that checks pressure
so loop() looks like:
void loop(void) {
// a point object holds x y and z coordinates
TSPoint p = ts.getPoint();
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
//if (p.z > ts.pressureThreshhold) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
//}
delay(100);
}
ok, got it working
the touchpaintdemo
use these pins:
#define YP A0 // must be an analog pin, use "An" notation!
#define XM A1 // must be an analog pin, use "An" notation!
#define YM 32 // can be any digital pin
#define XP 12 // can be any digital pin
and add a call to:
analogReadResolution(10);
in setup() before calling tft.begin();
is it supuse to be a blank white screen
the demo that is just touch, yes
but not the touchpaint demo
you said the GFX example worked? so sounds like the TFT part is working?
yea the grapich test example worked but I dont understand what you mean with TFT part
TFT = the actual screen with graphics
touch is coming from an overlay on top of that
two separate pieces of hardware
the GFX example doesn't use touch, just graphics on the TFT itself
the demo from the touch library only reads the touch overlay - nothing sent to TFT
the touchpaint demo however does both
on toutchpaint example after adding the analogread and the define. I get nothing on my screen and my serial monitor sais "19:50:58.547 -> �����x��x��x�x"
it does since when I try to upload the toutchpaint it just get stuck on the GFX deadbeef hellow screen page and print that "19:50:58.547 -> �����x��x��x�x" on serial monitor
that example was working before?
never tried the toutch paint
oh yea the GFX works perfect
yea it does
and should see this in serial monitor:
https://learn.adafruit.com/adafruit-2-4-color-tft-touchscreen-breakout/spi-wiring-test
bottom of page
but when I try to upload the toutchpaint and test that it get stuck on the deadbeef text and print the random things in the serial monitor
if deadbeef is still showing up, then it didn't upload the new sketch
the touchpaint demo doesn't show deadbeef
https://github.com/adafruit/Adafruit_ILI9341/blob/master/examples/breakouttouchpaint/breakouttouchpaint.ino
ok but now the screen is just blank/white and my serial monitor prints �����x��x��x�x��x�x�x���x��xx��xxxxx�x��x�xx��xxx�xxxxx�xx�x�x�x�x��
here's the full code for the modified example i am running locally
and when I go back to test the GFX it works (the gfx works)
if the above example doesn't work, then not sure what is happening. afaik we are running identical hardware.
be sure to change your wiring to use A0/A1
yup and do you also need to have a lower uploading speed?
also note that you are connected to that hardware SPI pins, so no need to #define those
if upload ends with something like:
Writing at 0x00059124... (100 %)
Wrote 303152 bytes (166462 compressed) at 0x00010000 in 2.6 seconds (effective 916.6 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
then should be OK
and if it were an issue, it would happen with any sketch
serial monitor baud rate must match sketch code though
and the ESP32 will output some gibberish initially after reset
that is expected
just ignore that
ok so I get this in my monitor "20:08:34.034 -> Ԋ���6�!� ��z�����Touch Paint!" aswell but my screen is still stuck from the previus sketch ie it does not upload I think
it's printing "Touch Paint!" though, so seems like it's loading and running
but not sure why the GFX example works, but not that one
try just power cycling the setup
maybe the TFT is in an odd state
and the RST pin is not being used (so relies on power cycle)
what is power cycling
unplug / replug USB cable
seem like when I try the original code example it updates the display
so its working now?
yes it works thanks
and when I do my own codes will I need to have the analog 10 before tft begin for every code
yes. you'll need that for the Adafruit_TouchScreen library to work properly on the ESP32.
there's at least one open issue that's related:
https://github.com/adafruit/Adafruit_TouchScreen/issues/39
that's a very old library written when "arduino" was only a single processor (atmega328) and ADC reads were always 10bit.
thanks for your time and help 🙂
@elder bison do you still have the screen and esp32 since I need help for a project using a loadcell to and a hx711
I have a problem that the screen is not working properly I can will add the code here to, the touches is not registering correctly. Have a try please
i thought touches were working? what changed?
in this code it seems like it has a hard time registering touches, It might be coused by the load cell I think or it could be the 10 bit thing but I have no clue why it does not register some touches
does the previous code that used to work still work? (can you repeat previous success?)
The code I have added here is the only version and the screen worket perfectly, but when I added the loadcell it started to lag and not be as responsive as before. (If you hook it up without a loadcell it is responsive and fast but when I hook up the loadcell and hx711 it start to lag)
even the serialmonitor dose not load the loadcell value as fast
this call works without the load cell attached?
scale.begin(DOUT_PIN, SCK_PIN);
Yes
but then the code runs faster, no code changes, just disconnect the load cell and it runs faster?
Yup
unknown. can try adding more serial prints to determine where the slowdown is occurring. may have something to do with the HX711 library being used.