Advertisement
thomazrb

Untitled

Dec 3rd, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const int potenciometro = A0;
  2. float valorVolts;
  3. int valor;
  4.  
  5. void setup()
  6. {
  7.   Serial.begin(9600);
  8. }
  9.  
  10. void loop()
  11. {
  12.   valor = analogRead(potenciometro);
  13.   valorVolts = valor * 5.0/1023.0;
  14.  
  15.   Serial.print("Valor do Potenciometro: ");
  16.   Serial.print(valor);
  17.   Serial.print("   Valor em Volts: ");
  18.   Serial.print(valorVolts);
  19.   Serial.println(" V");
  20.  
  21.   delay(200);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement