//In this sketch the brightness of the led goes from 0 to the max intensity. //with this sketch you learn about analogWrite int led_pin1 = 3; //define variable for the led pin int led_pin2 = 0; //define variable for the led pin void setup() { // put your setup code here, to run once: pinMode(led_pin1, OUTPUT); //set the led_pin as output pinMode(led_pin2, OUTPUT); //set the led_pin as output } void loop() { // put your main code here, to run repeatedly: analogWrite(led_pin1, 0); //set the Voltage LOW (ground) and Led turns off delay(500); //wait 500millisecond (0.5sec) analogWrite(led_pin2, 250); //set the Voltage HIGH and Led turns on. analogWrite(led_pin1, 50); delay(500); analogWrite(led_pin2, 200); analogWrite(led_pin1, 100); delay(500); analogWrite(led_pin2, 150); analogWrite(led_pin1, 150); delay(500); analogWrite(led_pin2, 100); analogWrite(led_pin1, 200); delay(500); analogWrite(led_pin2, 50); analogWrite(led_pin1, 250); delay(500); analogWrite(led_pin2, 0); delay(500); }