File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Adafruit_Feather_ESP32-S2
BME280_LC709203_Adafruit_IO
BME280_LC709203_Simple_Data Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 3333led = digitalio .DigitalInOut (board .LED )
3434led .switch_to_output ()
3535
36- # Pull the I2C power pin low
37- i2c_power = digitalio .DigitalInOut (board .I2C_POWER_INVERTED )
38- i2c_power .switch_to_output ()
39- i2c_power .value = False
40-
4136# Set up the BME280 and LC709203 sensors
4237bme280 = adafruit_bme280 .Adafruit_BME280_I2C (board .I2C ())
4338battery_monitor = LC709203F (board .I2C ())
5348
5449
5550def go_to_sleep (sleep_period ):
51+ # Turn off I2C power by setting it to input
52+ i2c_power = digitalio .DigitalInOut (board .I2C_POWER )
53+ i2c_power .switch_to_input ()
54+
5655 # Create a an alarm that will trigger sleep_period number of seconds from now.
5756 time_alarm = alarm .time .TimeAlarm (monotonic_time = time .monotonic () + sleep_period )
5857 # Exit and deep sleep until the alarm wakes us.
Original file line number Diff line number Diff line change 55"""
66import time
77import board
8- import digitalio
98from adafruit_bme280 import basic as adafruit_bme280
109from adafruit_lc709203f import LC709203F , PackSize
1110
12- # Pull the I2C power pin low
13- i2c_power = digitalio .DigitalInOut (board .I2C_POWER_INVERTED )
14- i2c_power .switch_to_output ()
15- i2c_power .value = False
16-
1711# Create sensor objects, using the board's default I2C bus.
1812i2c = board .I2C ()
1913bme280 = adafruit_bme280 .Adafruit_BME280_I2C (i2c )
You can’t perform that action at this time.
0 commit comments