From d24ccf2d590b73e56d49a737e0d5fc2b2a0d7de5 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 12 Dec 2023 15:32:04 +0000 Subject: [PATCH] examples: try to use auto-detect for pins first. --- examples/all.py | 5 ++++- examples/specific.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/all.py b/examples/all.py index 1fb58cb..31cd81b 100755 --- a/examples/all.py +++ b/examples/all.py @@ -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 @@ -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 diff --git a/examples/specific.py b/examples/specific.py index 3a52368..4b46533 100755 --- a/examples/specific.py +++ b/examples/specific.py @@ -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 @@ -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