mirror of
https://github.com/esphome/esphome.git
synced 2025-09-11 15:52:20 +01:00
[ESP32 ADC] Add option for raw uncalibrated output (#2663)
This commit is contained in:
committed by
GitHub
parent
2ac232e634
commit
219b225ac0
@@ -31,6 +31,7 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
||||
/// `HARDWARE_LATE` setup priority.
|
||||
float get_setup_priority() const override;
|
||||
void set_pin(InternalGPIOPin *pin) { this->pin_ = pin; }
|
||||
void set_output_raw(bool output_raw) { output_raw_ = output_raw; }
|
||||
float sample() override;
|
||||
|
||||
#ifdef USE_ESP8266
|
||||
@@ -39,8 +40,7 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
||||
|
||||
protected:
|
||||
InternalGPIOPin *pin_;
|
||||
uint16_t read_raw_();
|
||||
uint32_t raw_to_microvolts_(uint16_t raw);
|
||||
bool output_raw_{false};
|
||||
|
||||
#ifdef USE_ESP32
|
||||
adc_atten_t attenuation_{ADC_ATTEN_DB_0};
|
||||
|
Reference in New Issue
Block a user