lewapek / sds-dust-sensors-arduino-library

Library for Nova Fitness SDS dust sensors family (SDS011, SDS021)
MIT License
64 stars 19 forks source link

Add option for custom rxPin and txPin with HardwareSerial (e.g. for ESP32) #34

Open cyberman54 opened 2 years ago

cyberman54 commented 2 years ago

ESP32 boards support remapping of GPIO pins to Serial ports (UART0/1/2).

This PR enhances API in Serial.h with an option to pass custom rxPin and txPin to HardwareSerial. It keeps all usage options of the former API (i.e. for using SoftwareSerial), so this change shouldn't break any code created before this PR.