SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
analog_input.h
Go to the documentation of this file.
1#ifndef _analog_input_H_
2#define _analog_input_H_
3
4#include "analog_reader.h"
5#include "sensor.h"
6
7namespace sensesp {
8
41class AnalogInput : public FloatSensor {
42 public:
43 AnalogInput(uint8_t pin = A0, unsigned int read_delay = 200, String config_path = "",
44 float output_scale = 1024.);
45 void start() override final;
46
47 private:
48 uint8_t pin;
49 unsigned int read_delay;
50 float output_scale;
51 BaseAnalogReader* analog_reader;
52 virtual void get_configuration(JsonObject& doc) override;
53 virtual bool set_configuration(const JsonObject& config) override;
54 virtual String get_config_schema() override;
55 void update();
56};
57
58} // namespace sensesp
59
60#endif
Sensor for reading the MCU analog input pins.
void start() override final
Used by AnalogInput as a hardware abstraction layer.
Construct a new transform based on a single function.
Sensor template class for any sensor producing actual values.
Definition sensor.h:45