10#ifndef M5_UNIT_INFRARED_UNIT_ITR9606_HPP
11#define M5_UNIT_INFRARED_UNIT_ITR9606_HPP
13#include <M5UnitComponent.hpp>
25class UnitITR9606 :
public Component {
26 M5_UNIT_COMPONENT_HPP_BUILDER(UnitITR9606, 0x00);
54 bool begin()
override;
55 void update(
const bool force =
false)
override;
98 bool _prev_detected{};
100 bool _was_released{};
ITR9606 infrared photointerrupter unit.
bool wasDetected() const
Rising edge detection (object entered the slot)
Definition unit_ITR9606.hpp:71
void config(const config_t &cfg)
Set the config values.
Definition unit_ITR9606.hpp:49
bool readDetection(bool &detected)
Read the sensor pin state directly.
Definition unit_ITR9606.cpp:66
config_t config() const
Gets the config values.
Definition unit_ITR9606.hpp:44
bool isDetected() const
Current detection state.
Definition unit_ITR9606.hpp:63
bool wasReleased() const
Falling edge detection (object left the slot)
Definition unit_ITR9606.hpp:79
Top level namespace of M5Stack.
Settings for begin.
Definition unit_ITR9606.hpp:33
uint32_t interval
Definition unit_ITR9606.hpp:36