Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. /*
  2.   Esto es un ejemplo de un comentario en BLOQUE.
  3.   This is an example of a BLOCK comment.
  4.  */
  5. void setup() {
  6. //Esto es un ejemplo de un comentario en LÍNEA.
  7. //This is an example of a LINE comment
  8.  
  9. /*
  10.  
  11.    La instrucción Serial.begin(9600);
  12.    Prepara y activa el puerto serial a una razón de 9600 bauds por segundo.
  13.  
  14.    Instruction Serial.begin(9600);
  15.    Initialize serial communication at 9600 bauds per second:
  16.    
  17.  */
  18.  
  19.   Serial.begin(9600);
  20. }
  21.  
  22. // La rutina recursiva continuará "corriendo"
  23. // the loop routine runs over and over again forever:  
  24.  
  25. void loop() {
  26.  /*  
  27.      ¡AQUI OCURRE UNA ENTRADA!
  28.      int sensorValue: Declara una variable llamada sensorValue.
  29.      Esta variable (sensorValue) se declara como un número ENTERO (int)
  30.      int sensorValue = analogRead(A0): le asigna a la variable sensorValue
  31.      el valor que se obtiene a través del pin analogo "0"
  32.  
  33.      AN INPUT IS HAPPENING HERE!
  34.      int sensorValue: Declares a variable called sensorValue.
  35.      This variable is DECLARE and INITIALIZE as an INTEGER (int) number.
  36.      int sensorValue = analogRead(A0): Asigns the value read by the analog pin 0 (A0) to the variable (sensorValue)
  37.  
  38.  */
  39.   int sensorValue = analogRead(A0);
  40.  
  41. /*
  42.   ¡AQUI OCURRE UNA SALIDA!
  43.   Serial.println(sensorValue): Devuelve el valor de la variable (sensorValue).
  44.  
  45.   AN OUTPUT IS HAPPENING HERE!
  46.   Serial.println(sensorValue): Returns the value of the variable(sensorValue)
  47.  
  48.  */
  49.   Serial.println(sensorValue);
  50.   delay(10);        // tiempo (en segundos) entre cada lectura del "pin"
  51.                     // time (in seconds) between each reading
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement