ESPHome  2022.8.0
hx711.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
6 
7 namespace esphome {
8 namespace hx711 {
9 
10 enum HX711Gain {
14 };
15 
17  public:
18  void set_dout_pin(GPIOPin *dout_pin) { dout_pin_ = dout_pin; }
19  void set_sck_pin(GPIOPin *sck_pin) { sck_pin_ = sck_pin; }
20  void set_gain(HX711Gain gain) { gain_ = gain; }
21 
22  void setup() override;
23  void dump_config() override;
24  float get_setup_priority() const override;
25  void update() override;
26 
27  protected:
28  bool read_sensor_(uint32_t *result);
29 
33 };
34 
35 } // namespace hx711
36 } // namespace esphome
void set_gain(HX711Gain gain)
Definition: hx711.h:20
void update() override
Definition: hx711.cpp:27
bool read_sensor_(uint32_t *result)
Definition: hx711.cpp:35
This class simplifies creating components that periodically check a state.
Definition: component.h:266
void dump_config() override
Definition: hx711.cpp:20
void set_sck_pin(GPIOPin *sck_pin)
Definition: hx711.h:19
float get_setup_priority() const override
Definition: hx711.cpp:26
void setup() override
Definition: hx711.cpp:10
void set_dout_pin(GPIOPin *dout_pin)
Definition: hx711.h:18
Definition: a4988.cpp:4
Base-class for all sensors.
Definition: sensor.h:48