Skip to content

Instantly share code, notes, and snippets.

@esmarr58
Created November 25, 2017 03:37
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 esmarr58/44b2dc0749979b57dd1372e8596f131d to your computer and use it in GitHub Desktop.
Save esmarr58/44b2dc0749979b57dd1372e8596f131d to your computer and use it in GitHub Desktop.
int lecturaADC = 0;
void setup() {
pinMode(12,OUTPUT); //Salida a Alarma, aun sin uso
Serial.begin(9600);
}
void loop() {
/*
* #1
Lectura del canal 0 del ADC,
recordando que el ADC de Arduino
es de 10 Bits, el resultado se guardara
en una variable int (16 bits).
*/
lecturaADC = analogRead(A0);
/*
* Se imprime el valor despues del siguiente texto.
*/
Serial.print("El valor binario de salida en el sensor es: ");
Serial.println(lecturaADC);
/*
* Retardo de 3 segundos entre medicion.
*/
delay(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment