Skip to content

Commit 4c37152

Browse files
authored
Merge pull request #2121 from ladyada/main
power is enabled by the board variant, we dont need to do it manually
2 parents 4586e72 + a1a64b1 commit 4c37152

File tree

2 files changed

+4
-11
lines changed
  • Adafruit_Feather_ESP32-S2

2 files changed

+4
-11
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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
"""
66
import time
77
import board
8-
import digitalio
98
from adafruit_bme280 import basic as adafruit_bme280
109
from 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.
1812
i2c = board.I2C()
1913
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

0 commit comments

Comments
 (0)