|
M5Unit-INFRARED 0.2.0 git rev:76ad9e1
|
AS312 digital PIR motion sensor unit. More...
#include <unit_AS312.hpp>
Classes | |
| struct | config_t |
| Settings for begin. More... | |
Public Member Functions | |
| config_t | config () const |
| Gets the config values. | |
| void | config (const config_t &cfg) |
| Set the config values. | |
| bool | begin () override |
| void | update (const bool force=false) override |
Detection state | |
| bool | isDetected () const |
| Current detection state. | |
| bool | wasDetected () const |
| Rising edge detection. | |
| bool | wasReleased () const |
| Falling edge detection. | |
Direct reading | |
| bool | readDetection (bool &detected) |
| Read the sensor pin state directly. | |
Static Public Attributes | |
| static constexpr uint32_t | HOLD_TIME_MS {2300} |
| AS312 hold time in milliseconds (~2.3s) | |
AS312 digital PIR motion sensor unit.
The AS312 is a passive infrared (PIR) sensor with digital output. It detects motion by sensing changes in infrared radiation from human bodies or warm objects. The sensor outputs HIGH when motion is detected, LOW otherwise. Timing is fixed internally: ~2.3s hold time, ~2.3s blocking time.
|
inline |
Current detection state.
| bool m5::unit::UnitAS312::readDetection | ( | bool & | detected | ) |
Read the sensor pin state directly.
| [out] | detected | true if motion is detected |
|
inline |
Rising edge detection.
|
inline |
Falling edge detection.