Very important to know values detected by a sensor.
It can be used to verify if it works, how it works, which values returns
The yellow LED on pin 13 is set by default. There is in fact one little LED connected to pin 13. We should use it then! Here, in this example, just to indicate the moment in which the brightness is detected by the sensor.
click here to open the serial monitor of the Arduino IDE.
_value = 0
previous_value = 0
annotation: write the value of a sensor on the serial port
the variable _value is equal to... read the sensor: _generic_sensor
IF HAPPENS THAT _value is not equal to previous_value
write on the serial: valore_del_sensore_--> _value
the variable previous_value is equal to _value
SWITCH ON (5 Volt) _led_13
SWITCH OFF (0 Volt) _led_13