ESPHome 2026.5.1
Loading...
Searching...
No Matches
ads1118_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
8
9#include "../ads1118.h"
10
11namespace esphome::ads1118 {
12
14 public sensor::Sensor,
16 public Parented<ADS1118> {
17 public:
18 void update() override;
19
20 void set_multiplexer(ADS1118Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
21 void set_gain(ADS1118Gain gain) { this->gain_ = gain; }
22 void set_temperature_mode(bool temp) { this->temperature_mode_ = temp; }
23
24 float sample() override;
25
26 void dump_config() override;
27
28 protected:
32};
33
34} // namespace esphome::ads1118
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
This class simplifies creating components that periodically check a state.
Definition component.h:602
void set_gain(ADS1118Gain gain)
void set_multiplexer(ADS1118Multiplexer multiplexer)
Base-class for all sensors.
Definition sensor.h:47
Abstract interface for components to request voltage (usually ADC readings)
AlsGain501 gain
@ ADS1118_MULTIPLEXER_P0_NG
Definition ads1118.h:14