/* FabAcademy 2023 -Emma Pareschi In this skect the brithness of the led goes from 0 to the max intensity. With this sketch you learn about analogWrite */ int led_pin = 3; //define variable for the led pin void setup() { // put your setup code here, to run once: pinMode(led_pin, OUTPUT); //set the led_pin as output } void loop() { // put your main code here, to run repeatedly: analogWrite(led_pin, 0); //set the Voltage LOW (ground) and Led turns off delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin, 50); delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin, 100); delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin, 150); delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin, 200); delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin, 250); //set the Voltage very high (ground) and Led turns off delay(500); //wait 500millisecond (0.5sec) }