Skip to content

Commit

Permalink
Merge pull request #24 from pimoroni/patch-example-pins
Browse files Browse the repository at this point in the history
examples: try to use auto-detect for pins first.
  • Loading branch information
Gadgetoid authored Jan 11, 2024
2 parents c6bdeca + d24ccf2 commit 1c5360c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# Configure the PMS5003 for Enviro+
# pins and ports may vary for your hardware!

# Default, try to auto-detect platform
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600)

# Raspberry Pi 4 (Raspberry Pi OS)
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 4
# use "raspi-config" to enable serial, or add
Expand All @@ -24,7 +27,7 @@
# PIN15 and PIN13 are enable and reset for Raspberry Pi 5
# use "raspi-config" to enable serial, or add
# "dtoverlay=uart0-pi5" to /boot/firmware/config.txt
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13")
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13")

# ROCK 5B
# Use "armbian-config" to enable rk3568-uart2-m0
Expand Down
5 changes: 4 additions & 1 deletion examples/specific.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# Configure the PMS5003 for Enviro+
# pins and ports may vary for your hardware!

# Default, try to auto-detect platform
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600)

# Raspberry Pi 4 (Raspberry Pi OS)
# GPIO22 and GPIO27 are enable and reset for Raspberry Pi 4
# use "raspi-config" to enable serial, or add
Expand All @@ -23,7 +26,7 @@
# PIN15 and PIN13 are enable and reset for Raspberry Pi 5
# use "raspi-config" to enable serial, or add
# "dtoverlay=uart0-pi5" to /boot/firmware/config.txt
pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13")
# pms5003 = PMS5003(device="/dev/ttyAMA0", baudrate=9600, pin_enable="PIN15", pin_reset="PIN13")

# ROCK 5B
# Use "armbian-config" to enable rk3568-uart2-m0
Expand Down

0 comments on commit 1c5360c

Please sign in to comment.