Skip to content

Instantly share code, notes, and snippets.

@deviceplususer
Created October 17, 2019 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deviceplususer/28a364e709ac99dc5b2c02d56e6b11c6 to your computer and use it in GitHub Desktop.
Save deviceplususer/28a364e709ac99dc5b2c02d56e6b11c6 to your computer and use it in GitHub Desktop.
const int VOL_PIN = A0;
void setup(){
Serial.begin( 9600 );
}
void loop(){
int value;
float volt;
value = analogRead( VOL_PIN );
volt = value * 5.0 / 1023.0;
Serial.print( "Value: " );
Serial.print( value );
Serial.print( " Volt: " );
Serial.println( volt );
delay( 500 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment