ESPHome 2025.5.2
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ads1118_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
8
9#include "../ads1118.h"
10
11namespace esphome {
12namespace ads1118 {
13
15 public sensor::Sensor,
17 public Parented<ADS1118> {
18 public:
19 void update() override;
20
21 void set_multiplexer(ADS1118Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
22 void set_gain(ADS1118Gain gain) { this->gain_ = gain; }
23 void set_temperature_mode(bool temp) { this->temperature_mode_ = temp; }
24
25 float sample() override;
26
27 void dump_config() override;
28
29 protected:
33};
34
35} // namespace ads1118
36} // namespace esphome
Helper class to easily give an object a parent of type T.
Definition helpers.h:539
This class simplifies creating components that periodically check a state.
Definition component.h:301
void set_gain(ADS1118Gain gain)
void set_multiplexer(ADS1118Multiplexer multiplexer)
Base-class for all sensors.
Definition sensor.h:57
Abstract interface for components to request voltage (usually ADC readings)
AlsGain501 gain
@ ADS1118_MULTIPLEXER_P0_NG
Definition ads1118.h:15
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7