Skip to content

Conversation

@bwack
Copy link

@bwack bwack commented Jan 20, 2019

Should work just as fine for older sensors too which only require single byte to wake up.

bwack added 2 commits January 20, 2019 12:41
Should work just as fine for older sensors too which only require single byte to wake up.
_serial made private and as a pointer in hackAIR class for runtime declaration.
added int _rxPin and _txPIn private members
added constructor hackAIR::hackAIR(int sensorType, int rxpin, int txpin).
If the old constructor hackAIR::hackAIR(int sensorType) is called, default rx and txpin values are used. (for backwards compatibility).

Example usage:
const int rxpin=12, txpin=13;
hackAIR sensor(SENSOR_SDS011, rxpin, txpin);

---

for backward compatibility:
hackAIR sensor(SENSOR_SDS011);
@bwack bwack changed the title turnOn fix for newer SDS011 sensors turnOn fix for newer SDS011, and set rx and txpin in constructor (see commit description) Jan 20, 2019
@bwack bwack changed the title turnOn fix for newer SDS011, and set rx and txpin in constructor (see commit description) turnOn fix for newer SDS011, and set rx and txpin in constructor Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant