int value;
float volt;
float percent;
int max_value = 8191;
float max_volt = 3.3;
void setup() {
Serial.begin(115200);
}
void loop() {
value=analogRead(12);
volt=max_volt*value/max_value;
percent = value*100/max_value;
Serial.print("Value: ");
Serial.print(value);
Serial.print("\t");
Serial.print("Percent: ");
Serial.print(percent,2);
Serial.print("\t");
Serial.print("\t");
Serial.print("Voltage: ");
Serial.println(volt,1);
delay(100); // this speeds up the simulation
}