ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
ads1115_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
8
9#include "../ads1115.h"
10
11namespace esphome::ads1115 {
12
15 public PollingComponent,
17 public Parented<ADS1115Component> {
18 public:
19 void update() override;
20 void set_multiplexer(ADS1115Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
21 void set_gain(ADS1115Gain gain) { this->gain_ = gain; }
23 void set_samplerate(ADS1115Samplerate samplerate) { this->samplerate_ = samplerate; }
24 float sample() override;
25
26 void dump_config() override;
27
28 protected:
33};
34
35} // namespace esphome::ads1115
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:585
Internal holder class that is in instance of Sensor so that the hub can create individual sensors.
void set_samplerate(ADS1115Samplerate samplerate)
void set_resolution(ADS1115Resolution resolution)
void set_gain(ADS1115Gain gain)
void set_multiplexer(ADS1115Multiplexer multiplexer)
Base-class for all sensors.
Definition sensor.h:47
Abstract interface for components to request voltage (usually ADC readings)
AlsGain501 gain
Resolution resolution
Definition msa3xx.h:1