ESPHome  2024.11.1
ads1115_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/helpers.h"
5 
8 
9 #include "../ads1115.h"
10 
11 namespace esphome {
12 namespace ads1115 {
13 
16  public PollingComponent,
18  public Parented<ADS1115Component> {
19  public:
20  void update() override;
21  void set_multiplexer(ADS1115Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
22  void set_gain(ADS1115Gain gain) { this->gain_ = gain; }
23  void set_resolution(ADS1115Resolution resolution) { this->resolution_ = resolution; }
24  float sample() override;
25 
26  void dump_config() override;
27 
28  protected:
32 };
33 
34 } // namespace ads1115
35 } // namespace esphome
Abstract interface for components to request voltage (usually ADC readings)
void set_resolution(ADS1115Resolution resolution)
This class simplifies creating components that periodically check a state.
Definition: component.h:283
AlsGain501 gain
Internal holder class that is in instance of Sensor so that the hub can create individual sensors...
ADS1115Multiplexer multiplexer_
void set_gain(ADS1115Gain gain)
void set_multiplexer(ADS1115Multiplexer multiplexer)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
Helper class to easily give an object a parent of type T.
Definition: helpers.h:522