ESPHome 2026.2.1
Loading...
Searching...
No Matches
adc128s102_sensor.cpp
Go to the documentation of this file.
1#include "adc128s102_sensor.h"
2
3#include "esphome/core/log.h"
4
5namespace esphome {
6namespace adc128s102 {
7
8static const char *const TAG = "adc128s102.sensor";
9
10ADC128S102Sensor::ADC128S102Sensor(uint8_t channel) : channel_(channel) {}
11
13 LOG_SENSOR("", "ADC128S102 Sensor", this);
14 ESP_LOGCONFIG(TAG, " Pin: %u", this->channel_);
15 LOG_UPDATE_INTERVAL(this);
16}
17
18float ADC128S102Sensor::sample() { return this->parent_->read_data(this->channel_); }
20
21} // namespace adc128s102
22} // namespace esphome
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:65
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7