ThingPulse / esp8266-weather-station-color

ESP8266 Weather Station in Color using ILI9341 TFT 240x320 display
https://thingpulse.com/product/esp8266-wifi-color-display-kit-2-4/
MIT License
566 stars 221 forks source link

Non-TOUCH capable screens execute code as if touch is being pressed #80

Closed tikitunes closed 6 years ago

tikitunes commented 6 years ago

For a display without touch hardware installed, it appears TOUCH is available and is being pressed. Suggest a top-level TOUCHENABLED flag or a query for touch hardware (not sure if this is possible) to enable/disable touch capabilities.

Example of issue: With non-Touch capable screen and IS_STYLE_12HR = true, the hour repeatedly flashes between 12/24 hour values (e.g. hour rapidly switches between 13 and 1). It also flashes the PM, but that's a by-product of the HOUR issue.

Cause: loop() which always evaluates if (p.y < 80) as TRUE, so "IS_STYLE_12HR = !IS_STYLE_12HR" is repeated evaluated, causing rapid switch between 12 hour and 24 hour clocks.

Result: drawTime() repeatedly flashes between 12/24 hour values

tikitunes commented 6 years ago

@marcelstoer - I noticed your flag about this being non-reference hardware. That's correct, and something I should have made clearer in my post.

I bought my stuff before touch was enabled in the code.

In fact, when I bought my display from aliexpress I thought is was a touch display -- it had all the touch pins on the back. It was only when I looked at the front of the display and noticed the lack of the small ribbon cable to the screen that I realized I bought a non-touch display. It's still a great display. Just no-touch. Not sure how many people are in the same boat, but if it's a common problem it'd be great to have a condition to set for non-touch.

Since this is non-reference hw I'll close this issue and ask that you consider checking for non-touch screens sometime down the line.