KingDiamondPT
Published © GPL3+

Arduino UNO with LED RGB V2 Keyes

Eight Leds RGB attached to an Arduino UNO showing three colors (Blue, Green and Red)!

BeginnerProtip3,375
Arduino UNO with LED RGB V2 Keyes

Things used in this project

Hardware components

LED RGB V2 Keyes
×1
Arduino UNO
Arduino UNO
×1
Electronic Board
×1
12MM Dupond Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Wiring

A little hard to see but easy to know how to do it!

Code

28-04-2018_LED_RGB_V2_Keyes.ino.ino

Arduino
Easy to make and easy to learn!
void setup()
{
  //all pins are outputs and we are using 2 to 13
  for (int x =2;x<13;x++)
  {
    pinMode(x,OUTPUT);
    digitalWrite(x,HIGH);
  }
}
 
void loop()
{
   blue();
   cycle(); 
   green();
   cycle();
   red();
   cycle();
}
 
void blue()
{
  digitalWrite(12,LOW);
}
 
void green()
{
  digitalWrite(11,LOW);
}
 
void red()
{
  digitalWrite(10,LOW);
}
 
 
void cycle()
{
  for(int x=2;x<10;x++)
  {
    digitalWrite(x,LOW);
    delay(500);
    digitalWrite(x,HIGH);
  }
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
}

Credits

KingDiamondPT

KingDiamondPT

1 project • 0 followers

Comments