Making all the features of T-Wristband work in MicroPython
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
The 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.
The display setup parameters are available here:
When 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.
Create an account to leave a comment. Already have an account? Log In.
Very happy to see more progress on this project! *Please* do post code! People always say they will, but then don't ;-P I'd know, I'm always guilty of this myself!
If you have a "current" version of your code, you can just zip it up and send it to arsenijs at zerophone dot org, I'll clean it up from any leftover WiFi credentials and publish it on the existing GitHub repo, and then can add you as a contributor.
Yeah, the LSM IC is the next revision of the T-Wristband - my revision is earlier and has the MPU IC. Thank you, didn't know ESP32 actually does BT classic =)
What's the wireless like on these things? WiFi? Bluetooth?
It's just an ESP32-PICO-D4, which means there's WiFi and Bluetooth, no other RF stuff on the board. The antenna is a chip antenna, I didn't test the reception quality yet - currently trying to make the display work.
Become a member to follow this project and never miss any updates
Well, we have "regular" Bluetooth and BLE :-)
In the meanwhile I succeeded in getting the LSM9DS1 sensor up-and-running in python,and also the PCF8563 (RTC) on I2C address 0x51 (81)
(the LSM9DS1 doesn't use the default addresses, but 0x6B (107) and 0x1E (30))
Only thing missing is bluetooth, the rest is working ... (ubluetooth only does BLE)
Thank you for your effort, you where a big help in this :-)
I will post my code on github (next week, I'm on holidays for a week) and keep you informed.
By the time I'm back from holidays, I expect my liliygo T-watch 2020 in the mail :-)
- RTC is the same
- MTU is BMA423
- screen-resolution is 240x240 (ST7789V) with touchscreen (FT6236U)
- IR transmitter, vibration and speaker (MAX98357A as amplifier) built-in
From the looks of it, it looks like an apple watch, I'm sure my apple watch wrist-bands will fit on it :-)