File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Disconnected_CO2_Data_Logger Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 8
8
import sdcardio
9
9
import busio
10
10
import storage
11
- import adafruit_pcf8523
11
+ from adafruit_pcf8523 . pcf8523 import PCF8523
12
12
13
13
# setup for I2C
14
14
i2c = board .I2C () # uses board.SCL and board.SDA
15
15
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
16
16
# setup for SCD40
17
17
scd4x = adafruit_scd4x .SCD4X (i2c )
18
18
# setup for RTC
19
- rtc = adafruit_pcf8523 . PCF8523 (i2c )
19
+ rtc = PCF8523 (i2c )
20
20
# start measuring co2 with SCD40
21
21
scd4x .start_periodic_measurement ()
22
22
# list of days to print to the text file on boot
Original file line number Diff line number Diff line change 4
4
5
5
import time
6
6
7
- import adafruit_motor . servo
7
+ from adafruit_motor import servo
8
8
import board
9
9
import pwmio
10
10
from analogio import AnalogIn
11
11
from digitalio import DigitalInOut , Direction , Pull
12
12
13
13
pwm = pwmio .PWMOut (board .D5 , frequency = 50 )
14
- servo = adafruit_motor . servo . Servo ( pwm )
14
+
15
15
switch = DigitalInOut (board .D7 )
16
16
switch .direction = Direction .INPUT
17
17
switch .pull = Pull .UP
18
18
pot = AnalogIn (board .A0 )
19
19
20
- continuous = adafruit_motor .servo .ContinuousServo (pwm )
21
-
20
+ continuous = servo .ContinuousServo (pwm )
22
21
23
22
def val (pin ):
24
23
# divides voltage (65535) to get a value between 0 and 1
25
24
return pin .value / 65535
26
25
27
-
28
26
while True :
29
27
30
28
if switch .value :
You can’t perform that action at this time.
0 commit comments