Skip to content

Commit f70830b

Browse files
authored
Merge pull request #3 from dglaude/patch-1
Alternative serial connexion for serial PMS5003
2 parents 05b941d + 12cc7ba commit f70830b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

examples/pm25_simpletest.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,25 @@
1616
# reset_pin.value = False
1717

1818

19-
# If using with a computer such as Linux/RaspberryPi, Mac, Windows...
19+
# For use with a computer running Windows:
2020
# import serial
21-
#
2221
# uart = serial.Serial("COM30", baudrate=9600, timeout=1)
22+
23+
# For use with microcontroller board:
24+
# (Connect the sensor TX pin to the board/computer RX pin)
25+
# uart = busio.UART(board.TX, board.RX, baudrate=9600)
26+
27+
# For use with Raspberry Pi/Linux:
28+
# import serial
29+
# uart = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=0.25)
30+
31+
# For use with USB-to-serial cable:
32+
# import serial
33+
# uart = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=0.25)
34+
2335
# Connect to a PM2.5 sensor over UART
2436
# pm25 = adafruit_pm25.PM25_UART(uart, reset_pin)
2537

26-
2738
# Create library object, use 'slow' 100KHz frequency!
2839
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
2940
# Connect to a PM2.5 sensor over I2C

0 commit comments

Comments
 (0)