10#ifndef M5_UNIT_INFRARED_UNIT_ITR9606_HPP
11#define M5_UNIT_INFRARED_UNIT_ITR9606_HPP
13#include <M5UnitComponent.hpp>
25class UnitITR9606 :
public Component {
65 bool begin()
override;
70 void update(
const bool force =
false)
override;
113 bool _was_detected{};
114 bool _was_released{};
bool wasDetected() const
Rising edge detection (object entered the slot)
Definition unit_ITR9606.hpp:86
void config(const config_t &cfg)
Set the config values.
Definition unit_ITR9606.hpp:56
void update(const bool force=false) override
Read the sensor pin and update the detection state.
Definition unit_ITR9606.cpp:42
bool readDetection(bool &detected)
Read the sensor pin state directly.
Definition unit_ITR9606.cpp:65
config_t config() const
Gets the config values.
Definition unit_ITR9606.hpp:48
bool isDetected() const
Current detection state.
Definition unit_ITR9606.hpp:78
UnitITR9606()
Constructor.
Definition unit_ITR9606.hpp:40
bool begin() override
Set the RX pin to input with pull-up and apply the config.
Definition unit_ITR9606.cpp:23
bool wasReleased() const
Falling edge detection (object left the slot)
Definition unit_ITR9606.hpp:94
Top level namespace of M5Stack.
Settings for begin.
Definition unit_ITR9606.hpp:33
uint32_t interval
Definition unit_ITR9606.hpp:36