Skip to content

Commit b2183e8

Browse files
authored
Merge branch 'master' into scrolling-clouds-update
2 parents b986182 + 693f8f2 commit b2183e8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/main.py renamed to PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython/PMS5003_example.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
import board
2-
import busio
3-
from digitalio import DigitalInOut, Direction
4-
51
try:
62
import struct
73
except 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
1410
uart = 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+
1620
buffer = []
1721

1822
while True:

0 commit comments

Comments
 (0)