ESPHome 2025.5.0
Loading...
Searching...
No Matches
mcp4725.h
Go to the documentation of this file.
1#pragma once
2
6
7static const uint8_t MCP4725_ADDR = 0x60;
8static const uint8_t MCP4725_RES = 12;
9
10namespace esphome {
11namespace mcp4725 {
12class MCP4725 : public Component, public output::FloatOutput, public i2c::I2CDevice {
13 public:
14 void setup() override;
15 void dump_config() override;
16 void write_state(float state) override;
17
18 protected:
19 enum ErrorCode { NONE = 0, COMMUNICATION_FAILED } error_code_{NONE};
20};
21
22} // namespace mcp4725
23} // namespace esphome
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
void setup() override
Definition mcp4725.cpp:9
void dump_config() override
Definition mcp4725.cpp:19
enum esphome::mcp4725::MCP4725::ErrorCode NONE
void write_state(float state) override
Definition mcp4725.cpp:28
Base class for all output components that can output a variable level, like PWM.
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7