Created
April 1, 2020 20:30
-
-
Save HectorTorres/307a599d1b9b8c5aedc53a7cf5e7fa27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pinSensor = A0; // potenciómetro (terminal centrall) conectado al pin analógico 0 | |
// terminales exteriores a +5 V y a GND | |
int valor = 0; // variable para almacenar el valor leido | |
void setup() | |
{ | |
Serial.begin(9600); // configuración del puerto serie a 9600 baudios | |
} | |
void loop() | |
{ | |
valor = analogRead(pinSensor); // lee el pin de entrada | |
Serial.println(valor); // imprime el valor | |
delay(200); //Retraso hasta la siguiente lectura | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment