#ESP32-S3 Deep Sleep from Circuit Python
1 messages · Page 1 of 1 (latest)
Did you have a look at this guide? https://learn.adafruit.com/deep-sleep-with-circuitpython/overview
I found some examples in there that helped me get into the whole sleeping thing.
That's a good lead. I'll give it a read. Thanks!
OK... I think I have deep sleep working. Now, trying to figure out how to power down the I2C bus (sensor has an LED on it, want that OFF), and the power to the screen. I note that there are pins for this, but the coding has eluded me.
(hardware is ESP32-S3 Rev TFT with a SHT4x hanging on the I2C bus)
Will this work?
import digitalio
import board
i2c_power = digitalio.DigitalInOut(board.I2C_POWER)
i2c_power.switch_to_input()```
After much gnashing of teeth, I got this working.
print ("TFT, I2C, NEO powering down")
#Turn off power to the TFT, I2C bus. This is not working yet.
TFTpwr = digitalio.DigitalInOut(board.TFT_I2C_POWER)
TFTpwr.direction = digitalio.Direction.OUTPUT
TFTpwr.value = 0
print ("")
NEOpwr = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
NEOpwr.direction = digitalio.Direction.OUTPUT
NEOpwr.value = 0
# Create a an alarm that will trigger TestInterval seconds from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + TestInterval*NormalReportIntervals)
# Exit the program, and then deep sleep until the alarm wakes us.
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
# Does not return, so we never get here.