#yes

1 messages · Page 1 of 1 (latest)

elder bison
muted furnace
#

no

#

it only prints GPIO can only be used as input mode

elder bison
#

try leaving the serial monitor open and then press reset on the feather

#

it's unclear what is printing that message

muted furnace
#

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"

elder bison
#

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

muted furnace
#

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

elder bison
muted furnace
#

the graphictest works

elder bison
#

weird. what version of the arduino ide are you using?

muted furnace
#

2.2.1

elder bison
#

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

muted furnace
#

yup that is the same error I get

elder bison
#

ok, will need to look at this a bit...

muted furnace
#

but I could not recreate it using 1.8.19 since it does not find the usb port

misty ingot
#

couldnt they just set the pin as an output in their code since esp32 have reconfigurable pins ?

#

ie: pinMode(GPIO, OUTPUT);

muted furnace
#

could you guide me through it since I dont understand I am quite new

misty ingot
#

I used they because I want cater to validate if it's a good idea first

misty ingot
#

@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

elder bison
muted furnace
#

did you get it to work on your setup?

#

which pins did you use then

elder bison
#

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

#

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();

muted furnace
#

is it supuse to be a blank white screen

elder bison
#

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?

muted furnace
#

yea the grapich test example worked but I dont understand what you mean with TFT part

elder bison
#

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

muted furnace
#

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"

elder bison
#

make sure the basic GFX example still works

muted furnace
#

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

elder bison
#

that example was working before?

muted furnace
#

never tried the toutch paint

elder bison
#

this is not the touch paint example

#

it's the basic graphics example

#

no touch

muted furnace
#

oh yea the GFX works perfect

elder bison
#

it should do more than show the deadbeef text

#

should print some triangle, etc also?

muted furnace
#

yea it does

elder bison
#

bottom of page

muted furnace
#

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

elder bison
#

if deadbeef is still showing up, then it didn't upload the new sketch

muted furnace
#

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��

elder bison
muted furnace
#

and when I go back to test the GFX it works (the gfx works)

elder bison
#

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

muted furnace
#

yup and do you also need to have a lower uploading speed?

elder bison
#

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

muted furnace
#

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

elder bison
#

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)

muted furnace
#

what is power cycling

elder bison
#

unplug / replug USB cable

muted furnace
#

seem like when I try the original code example it updates the display

elder bison
#

so its working now?

muted furnace
#

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

elder bison
#

yes. you'll need that for the Adafruit_TouchScreen library to work properly on the ESP32.

#

that's a very old library written when "arduino" was only a single processor (atmega328) and ADC reads were always 10bit.

muted furnace
#

thanks for your time and help 🙂

muted furnace
#

@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

elder bison
#

i thought touches were working? what changed?

muted furnace
elder bison
muted furnace
#

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

elder bison
#

this call works without the load cell attached?

  scale.begin(DOUT_PIN, SCK_PIN);
elder bison
#

but then the code runs faster, no code changes, just disconnect the load cell and it runs faster?

elder bison
#

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.

muted furnace
#

@elder bison I belive it is this bit of code weight = (scale.get_units(10) * -1000);

#

but if I dont use it does not load the weight