void setup() {
// turn on LED to signal the start of the calibration period:
pinMode(13, OUTPUT);
+ pinMode(ledPin, OUTPUT);
digitalWrite(13, HIGH);
// calibrate during the first five seconds
if (sensorValue < sensorMin) {
sensorMin = sensorValue;
}
+ delay(5); // Let the sensor rest a bit and stabilize
}
// signal the end of the calibration period
1. Modificare lo sketch in modo che modifichi la luminosita' di un led
via PWM tramite il valore letto dal sensore.
2. Come fare per costringere la variabile dentro un intervallo stabilito?
+*/