Closed neilpas23 closed 1 year ago
I've trouble shot it down to the lcd.init(); function. When you call lcd.init(); in setup gpio-0 gets shorted to LOW, it will only read out 0.
I hate people who do not attach code to Issues. Please provide proof first.
One possibility is that you are using autodetect and have changed the GPIO settings prior to that. You should set the pin mode later than lcd.init.
static LGFX lcd; int buttonVal;
void setup() {
Serial.begin(115200);
pinMode(0, INPUT_PULLUP);
lcd.init();
}
void loop() { buttonVal = digitalRead(0); Serial.println(buttonVal);
}
If you comment out lcd.init(); button on gpio-0 goes back to working as normal Sorry for not adding code.
You should set the pin mode later than lcd.init.
static LGFX lcd; int buttonVal;
void setup() {
Serial.begin(115200);
lcd.init();
pinMode(0, INPUT_PULLUP);
}
void loop() { buttonVal = digitalRead(0); Serial.println(buttonVal);
}
The result with this is the same, still all 0s. And checking now commenting out lcd.init(); button goes back to working.
Are you use latest version ?
I have lost my T-Display and cannot verify.
Just downloaded and replaced to 1.1.5 off the github instead of loading it thought the Arduino IDE. Reset and recompiled. Can confirm that this is still occurring. Maybe someone else on the GIT can verify if they own a T-display.
umm,
please comment out this line...
#define LGFX_AUTODETECT
And, please set the debug log level to verbose and present the contents of the serial output.
no, it's build log I mean runtime output log.
23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0 23:42:38.348 -> 0
The Serial Monitor just updates 0s on loop because thats all thats printing. It should be printing 1, and 0 when the button is pressed. There is no other information in any of the Outputs once the program is sent to the device.
boot log...
I mean this...
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13220
ho 0 tail 12 room 4
load:0x40080400,len:3028
entry 0x400805e4
[ 5][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[ 3035][I][LGFX_AutoDetect_ESP32_all.hpp:1008] init_impl(): [LovyanGFX] [Autodetect] load from NVS : board:9
[ 3036][V][LGFX_AutoDetect_ESP32_all.hpp:3350] autodetect(): [LGFX] pkg: 0
[ 3041][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[ 3063][I][LGFX_AutoDetect_ESP32_all.hpp:2353] setup(): [LovyanGFX] [Autodetect] TTGO_TDisplay
23:51:46.998 -> ets Jul 29 2019 12:21:46 23:51:46.999 -> 23:51:46.999 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 23:51:46.999 -> configsip: 0, SPIWP:0xee 23:51:46.999 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 23:51:46.999 -> mode:DIO, clock div:1 23:51:46.999 -> load:0x3fff0018,len:4 23:51:46.999 -> load:0x3fff001c,len:1044 23:51:46.999 -> load:0x40078000,len:10124 23:51:46.999 -> load:0x40080400,len:5856 23:51:46.999 -> entry 0x400806a8
Thats all the info it gives me before it starts printing 0s
ログレベルを上げてください
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:10124 load:0x40080400,len:5856 entry 0x400806a8 [I][LGFX_AutoDetect_ESP32_all.hpp:1008] init_impl(): [Autodetect] load from NVS : board:9 [V][LGFX_AutoDetect_ESP32_all.hpp:3304] autodetect(): pkg: 0 [V][LGFX_AutoDetect_ESP32_all.hpp:714] _read_panel_id(): [Autodetect] read cmd:04 = ff528585 [I][LGFX_AutoDetect_ESP32_all.hpp:2308] setup(): [Autodetect] TTGO_TDisplay
ArduinoESP32 v1.0.6を使っていますか? もしそうであれば、v2.0.xに変更してみてください。
I am using Arduino IDE 2.0.4.
no... it's IDE version... I mean Arduino core for ESP32 ( board manager ) version
I have found areas that may be affected and made adjustments. You can grab the code from the develop branch and try it out.
I though I had latest for Arduino ESP32 but I guess I didn't. Updated to 2.0.7 and I believe it works now. Should I still try the change you just made?
If it has been resolved, that's fine.
Thank You
I'm currently using LovyanGFX because its the only library that I can scale/flip sprites in for a game. My issue is that it seems like the GPIO-0 Button on the TTGO T-Display doesn't work while using this library? Is it possible that this library could be effecting that button in some way?