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 33
33
led = digitalio .DigitalInOut (board .LED )
34
34
led .switch_to_output ()
35
35
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
-
41
36
# Set up the BME280 and LC709203 sensors
42
37
bme280 = adafruit_bme280 .Adafruit_BME280_I2C (board .I2C ())
43
38
battery_monitor = LC709203F (board .I2C ())
53
48
54
49
55
50
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
+
56
55
# Create a an alarm that will trigger sleep_period number of seconds from now.
57
56
time_alarm = alarm .time .TimeAlarm (monotonic_time = time .monotonic () + sleep_period )
58
57
# Exit and deep sleep until the alarm wakes us.
Original file line number Diff line number Diff line change 5
5
"""
6
6
import time
7
7
import board
8
- import digitalio
9
8
from adafruit_bme280 import basic as adafruit_bme280
10
9
from adafruit_lc709203f import LC709203F , PackSize
11
10
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
-
17
11
# Create sensor objects, using the board's default I2C bus.
18
12
i2c = board .I2C ()
19
13
bme280 = adafruit_bme280 .Adafruit_BME280_I2C (i2c )
You can’t perform that action at this time.
0 commit comments