-
VBAT/VBUS/charging detection works
04/21/2020 at 00:08 • 0 commentsThe simplest of them all, of course. Relevant commit here: https://github.com/CRImier/micropython-ttgo-wristband/commit/1c18ad2c090ea79f16ca9d401313ea753f14438c The magic number multiplier for ADC-to-volts is 0.00169, which is kinda nice.
-
Display config
04/06/2020 at 20:05 • 0 commentsThe display setup parameters are available here:
-
ESP32, MicroPython, TTP223 GPIOs and deepsleep
04/05/2020 at 19:29 • 0 commentsWhen you refer to the T-Wristband schematic, you'll see that not only the touch button (GPIO33) is controlled by a separate TTP223 chip (and not ESP32 built-in touch peripheral), but the TTP223 chip is also powered from an ESP32 GPIO. This means you need to make the "TTP223 power" GPIO (25) into an output and make sure it's still an output during deepsleep. How to do this in MicroPython? Here's a minimal example:
from machine import Pin, deepsleep from time import sleep import esp32 touch_en_p = 25 touch_p = 33 touch = Pin(touch_p, Pin.IN) Pin(touch_en_p, Pin.OUT, Pin.PULL_HOLD, value=1) esp32.wake_on_ext0(pin=touch, level=esp32.WAKEUP_ANY_HIGH) print("Will sleep in 5 seconds") sleep(5) print("Going to sleep") deepsleep()
The PULL_HOLD and value=1 are what's responsible for the "make sure the TTP223 stays powered on" task.