Created
January 19, 2015 22:57
-
-
Save odrix/2bc6e6e0186bc1735941 to your computer and use it in GitHub Desktop.
Simple change RGB Led color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define pinRouge 9 | |
#define pinVert 10 | |
#define pinBleu 11 | |
#define intervalTemps 800 | |
void setup() | |
{ | |
pinMode(pinRouge, OUTPUT); | |
pinMode(pinVert, OUTPUT); | |
pinMode(pinBleu, OUTPUT); | |
} | |
void loop() | |
{ | |
allumeLed(0,0,1); | |
delay(intervalTemps); | |
allumeLed(0,1,1); | |
delay(intervalTemps); | |
allumeLed(0,1,0); | |
delay(intervalTemps); | |
allumeLed(1,1,0); | |
delay(intervalTemps); | |
allumeLed(1,0,0); | |
delay(intervalTemps); | |
allumeLed(1,0,1); | |
delay(intervalTemps); | |
} | |
void allumeLed(boolean rouge, boolean vert, boolean bleu) | |
{ | |
digitalWrite(pinRouge, rouge); | |
digitalWrite(pinVert, vert); | |
digitalWrite(pinBleu, bleu); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment