Devices & Components
Arduino Uno Rev3
LED RGB V2 Keyes
12MM Dupond Cable
Electronic Board
Software & Tools
Arduino IDE
Project description
Code
28-04-2018_LED_RGB_V2_Keyes.ino.ino
arduino
Easy to make and easy to learn!
1void setup() 2{ 3 //all pins are outputs and we are using 2 to 13 4 for (int x =2;x<13;x++) 5 { 6 pinMode(x,OUTPUT); 7 digitalWrite(x,HIGH); 8 } 9} 10 11void loop() 12{ 13 blue(); 14 cycle(); 15 green(); 16 cycle(); 17 red(); 18 cycle(); 19} 20 21void blue() 22{ 23 digitalWrite(12,LOW); 24} 25 26void green() 27{ 28 digitalWrite(11,LOW); 29} 30 31void red() 32{ 33 digitalWrite(10,LOW); 34} 35 36 37void cycle() 38{ 39 for(int x=2;x<10;x++) 40 { 41 digitalWrite(x,LOW); 42 delay(500); 43 digitalWrite(x,HIGH); 44 } 45 digitalWrite(10,HIGH); 46 digitalWrite(11,HIGH); 47 digitalWrite(12,HIGH); 48} 49
Downloadable files
Wiring
A little hard to see but easy to know how to do it!
Wiring
Wiring
A little hard to see but easy to know how to do it!
Wiring
Comments
Only logged in users can leave comments