Sample Code
LED Strip driving code
Here's the basic code for controlling the color of the RGB LED strip.
int RedPin = 10;
int GreenPin = 11;
int BluePin = 9;
void setColor(int red, int green, int blue)
{
analogWrite(RedPin, red);
analogWrite(GreenPin, green);
analogWrite(BluePin, blue);
}
void setup()
{
pinMode(RedPin, OUTPUT);
pinMode(GreenPin, OUTPUT);
pinMode(BluePin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
for (int i=0;i<255;i++)
{
setColor(i, 0, 0);
delay (10);
}
delay(2000);
for (int i=0;i<255;i++)
{
Arrow.com.
Arrow.com.
Arrow.com.
Downloaded from
Downloaded from
Downloaded from
//Arduino driving pin for Red
//Arduino driving pin for Green
//Arduino driving pin for Blue
//Init Arduino driving pins
//Changing Red brightness
//Changing Green brightness
Need help?
Do you have a question about the DFR0274 and is the answer not in the manual?