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-
51try :
62 import struct
73except ImportError :
84 import ustruct as struct
95
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
1410uart = busio .UART (board .TX , board .RX , baudrate = 9600 )
1511
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+
1620buffer = []
1721
1822while True :
You can’t perform that action at this time.
0 commit comments