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 88import sdcardio
99import busio
1010import storage
11- import adafruit_pcf8523
11+ from adafruit_pcf8523 . pcf8523 import PCF8523
1212
1313# setup for I2C
1414i2c = board .I2C () # uses board.SCL and board.SDA
1515# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1616# setup for SCD40
1717scd4x = adafruit_scd4x .SCD4X (i2c )
1818# setup for RTC
19- rtc = adafruit_pcf8523 . PCF8523 (i2c )
19+ rtc = PCF8523 (i2c )
2020# start measuring co2 with SCD40
2121scd4x .start_periodic_measurement ()
2222# list of days to print to the text file on boot
Original file line number Diff line number Diff line change 44
55import time
66
7- import adafruit_motor . servo
7+ from adafruit_motor import servo
88import board
99import pwmio
1010from analogio import AnalogIn
1111from digitalio import DigitalInOut , Direction , Pull
1212
1313pwm = pwmio .PWMOut (board .D5 , frequency = 50 )
14- servo = adafruit_motor . servo . Servo ( pwm )
14+
1515switch = DigitalInOut (board .D7 )
1616switch .direction = Direction .INPUT
1717switch .pull = Pull .UP
1818pot = AnalogIn (board .A0 )
1919
20- continuous = adafruit_motor .servo .ContinuousServo (pwm )
21-
20+ continuous = servo .ContinuousServo (pwm )
2221
2322def val (pin ):
2423 # divides voltage (65535) to get a value between 0 and 1
2524 return pin .value / 65535
2625
27-
2826while True :
2927
3028 if switch .value :
You can’t perform that action at this time.
0 commit comments