Skip to content

Commit 1905c10

Browse files
authored
Merge pull request #922 from kattni/update-pms5003
Updating for Pi.
2 parents 18e6ea7 + ace73c3 commit 1905c10

File tree

1 file changed

+8
-8
lines changed
  • PMS5003_Air_Quality_Sensor/PMS5003_CircuitPython

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
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+
1616
buffer = []
1717

1818
while True:

0 commit comments

Comments
 (0)