ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
ns2009.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::ns2009 {
7
9 public:
11 void set_threshold(uint8_t threshold) { this->threshold_ = threshold; }
12
13 void setup() override;
14 void dump_config() override;
15
16 protected:
17 void update_touches() override;
19 optional<uint16_t> read_axis_(uint8_t cmd);
20
22 uint8_t threshold_{40};
23};
24
25} // namespace esphome::ns2009
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
void set_threshold(uint8_t threshold)
Set the threshold for the touch detection.
Definition ns2009.h:11
optional< uint16_t > read_axis_(uint8_t cmd)
Read a 12 bit axis value, or nothing when the read fails.
Definition ns2009.cpp:49
uint8_t threshold_
The threshold at which a touch is registered.
Definition ns2009.h:22
void update_touches() override
Definition ns2009.cpp:20