ESP-12f, Arduino IDE 1.6.9, ESP Core 2.3.0. My Sketch:
uint8_t adc_what_I_want = ADC_TOUT;
ADC_MODE(adc_what_I_want);
extern "C" {
#include "user_interface.h"
}
#define PIN_ADC_PWR 14
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(PIN_ADC_PWR,OUTPUT);
pinMode(A0,INPUT);
digitalWrite(PIN_ADC_PWR,HIGH);
}
void loop() {
delay(500);
adc_what_I_want = ADC_TOUT;
delay(100);
unsigned int val = analogRead(A0);
delay(100);
Serial.print("read A0 ");
Serial.println(val);
adc_what_I_want = ADC_VCC;
delay(100);
float ppp = ESP.getVcc();
Serial.print("read Vcc ");
Serial.println(ppp);
}
martinayotte wrote:Ugly, right ?Well, yeah. But I don't care as long as it works
Thanks & best!