Skip to content

Commit bdef79c

Browse files
committed
power is enabled by the board variant, we dont need to do it manually
1 parent 3e906a1 commit bdef79c

File tree

2 files changed

+4
-10
lines changed
  • Adafruit_Feather_ESP32-S2

2 files changed

+4
-10
lines changed

Adafruit_Feather_ESP32-S2/BME280_LC709203_Adafruit_IO/code.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
led = digitalio.DigitalInOut(board.LED)
3434
led.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
4237
bme280 = adafruit_bme280.Adafruit_BME280_I2C(board.I2C())
4338
battery_monitor = LC709203F(board.I2C())
@@ -53,6 +48,10 @@
5348

5449

5550
def 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.

Adafruit_Feather_ESP32-S2/BME280_LC709203_Simple_Data/code.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
from adafruit_bme280 import basic as adafruit_bme280
1010
from adafruit_lc709203f import LC709203F, PackSize
1111

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-
1712
# Create sensor objects, using the board's default I2C bus.
1813
i2c = board.I2C()
1914
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

0 commit comments

Comments
 (0)