esphome/esphome/components/mcp3204/sensor/mcp3204_sensor.h
rsumner a4431abea8
MCP3204 4-channel 12-bit ADC component (#2895)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 12:04:48 +13:00

30 lines
710 B
C++

#pragma once
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/voltage_sampler/voltage_sampler.h"
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#include "../mcp3204.h"
namespace esphome {
namespace mcp3204 {
class MCP3204Sensor : public PollingComponent,
public Parented<MCP3204>,
public sensor::Sensor,
public voltage_sampler::VoltageSampler {
public:
MCP3204Sensor(uint8_t pin);
void update() override;
void dump_config() override;
float get_setup_priority() const override;
float sample() override;
protected:
uint8_t pin_;
};
} // namespace mcp3204
} // namespace esphome