Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arduino Volt Meter
int myVoltageReading = 5.14;
unsigned int analogIn = 0;
void setup()
{
Serial.begin(115200);
}
void loop()
{
analogIn = analogRead(A0);
analogIn = map(a, 0, 1023, 0, myVoltageReading * 1000);
if (analogIn < 10) Serial.print("0");
if (analogIn < 100) Serial.print("0");
if (analogIn < 1000) Serial.print("0");
if (analogIn < 10000) Serial.print("0");
Serial.println(a, DEC);
delay(150);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.