File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 1
- import board
2
- import busio
3
- from digitalio import DigitalInOut , Direction
4
-
5
1
try :
6
2
import struct
7
3
except ImportError :
8
4
import ustruct as struct
9
5
10
- led = DigitalInOut ( board . D13 )
11
- led . direction = Direction . OUTPUT
12
-
13
- # Connect the Sensor's TX pin to the board's RX pin
6
+ # Connect the sensor TX pin to the board/computer RX pin
7
+ # For use with a microcontroller board:
8
+ import board
9
+ import busio
14
10
uart = busio .UART (board .TX , board .RX , baudrate = 9600 )
15
11
12
+ # For use with Raspberry Pi/Linux:
13
+ # import serial
14
+ # uart = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=0.25)
15
+
16
+ # For use with USB-to-serial cable:
17
+ # import serial
18
+ # uart = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=0.25)
19
+
16
20
buffer = []
17
21
18
22
while True :
You can’t perform that action at this time.
0 commit comments