




Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!





|Facultad de Ingeniería Laboratorio de Arquitectura de computadoras
Cargue la siguiente programación de control mediante la estructura switch case. Implemente los siguientes requerimientos mediante la estructura switch case, copie el código modo texto y capture la pantalla. void setup () { // initialize serial communication: Serial.begin(9600); } void loop () { // read the sensor: int sensorReading = analogRead(A0); // map the sensor range to a range of four options: int range = map(sensorReading, sensorMin, sensorMax, 0, 3); // do something different depending on the range value: switch (range) { case 0: // your hand is on the sensor Serial.println("totalmente oscuro "); break; case 1: // your hand is close to the sensor Serial.println("oscuro"); break; case 2: // your hand is a few inches from the sensor Serial.println("medianamente oscuro "); break; case 3: // your hand is nowhere near the sensor Serial.println("brillante"); break; } delay(1); // delay in between reads for stability } // sensor minimum, discovered through experiment // sensor maximum, discovered through experiment const int sensorMin = 0; const int sensorMax = 600;
Investigar sobre la instrucciones: