v1.1.0
🎉 Major improvements!
Serial communications are now MUCH faster!
-
The original method induced a 1-second delay after every command; now, after a command is sent, it awaits a response of either “Done” or “Error” so that it can return instantly.
-
Now that sending commands involves checking for a “Done” or “Error” response, all configuration methods now return boolean to indicate whether the change was successful.
-
Reading presence status via serial is now almost as fast as
digitalRead()
.
New methods:
-
configBegin()
andconfigEnd()
allow you to make multiple configuration changes efficiently. Normally, calling any of the configuration functions will stop the sensor, send the command, save the configuration, then re-start the sensor. Calling multiple configuration functions back-to-back means there are multiple stop/save/start cycles. By wrapping those calls betweenconfigBegin()
andconfigEnd()
, there is only one call to stop, save, and start. -
setTriggerLatency()
allows you to configure presence assertion/de-assertion:- Confirmation: amount of time that continuous presence activity must be detected before asserting a presence state
- Disappearance: amount of time during which there must be no presence activity before de-asserting a presence state
-
begin()
doesn’t currently do anything, but reserved for future use.
Removed auto-start functions:
Removed methods related to auto-start since there’s not a clean and straightforward way to determine whether the sensor is running. The factory default is for the sensor to automatically start on power-up, so it’s safer to operate around that assumption.
I may restore these methods at a later date, especially if I decide on what begin()
will do.