LED Module – 2-Colour Flash

$4.85

20 in stock

Description

2-Color LED Module Code


/* SETUP

2 Color LED    Arduino
-       -      GND
        -      D10
S       -      D11
*/
 
int redpin = 11; // select the pin for the red LED
int greenpin = 10; // select the pin for the green LED
int val;
void setup () {
   pinMode (redpin, OUTPUT);
   pinMode (greenpin, OUTPUT);
}
void loop () {
   for (val = 255; val> 0; val--)
      {
      analogWrite (greenpin, val);
      analogWrite (redpin, 255-val);
      delay (15);
   }
   for (val = 0; val <255; val++)
      {
      analogWrite (greenpin, val);
      analogWrite (redpin, 255-val);
      delay (15);
   }  
}

 

Additional information

Weight 0.002 kg

There are no reviews yet.

Be the first to review “LED Module – 2-Colour Flash”

Your email address will not be published. Required fields are marked *