5 #include <driver/adc.h> 10 static const char *
const TAG =
"esp32_hall";
13 adc1_config_width(ADC_WIDTH_BIT_12);
14 int value_int = hall_sensor_read();
15 float value = (value_int / 4095.0f) * 10000.0f;
16 ESP_LOGD(TAG,
"'%s': Got reading %.0f µT", this->
name_.
c_str(), value);
std::string unique_id() override
void dump_config() override
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.
void publish_state(float state)
Publish a new state to the front-end.
constexpr const char * c_str() const
Implementation of SPI Controller mode.