// WeMos Analog Read Sample
extern "C" {
#include "user_interface.h"
}
#define RefV 3.3
void setup() {
Serial.begin(9600);
}
void loop() {
uint ADC_Value;
float voltage;
ADC_Value = system_adc_read();
Serial.print("ADC_Value:");
Serial.print(ADC_Value);
Serial.print(" ");
voltage=float(ADC_Value)/1023.0*RefV;
Serial.print("voltage:");
Serial.println(voltage);
delay(1000);
} |