Skip to content

Instantly share code, notes, and snippets.

@LuizFelipeLemon
Last active November 11, 2017 03:20
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 LuizFelipeLemon/9db8f1123be074ca9617927c8d2c072c to your computer and use it in GitHub Desktop.
Save LuizFelipeLemon/9db8f1123be074ca9617927c8d2c072c to your computer and use it in GitHub Desktop.
#define pot A5 //Nomeia a porta A5 como pot
void setup(){
Serial.begin(9600); //Inicia a Serial
pinMode(pot,INPUT); //Define o pino A5 como entrada
}
void loop(){
float voltage = 0.00489 * analogRead(pot); // Armazenda valor da tensão
Serial.print(voltage); // Mostra na Serial
Serial.println(" V");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment