Skip to content

Instantly share code, notes, and snippets.

@odrix
Created January 19, 2015 22:57
Show Gist options
  • Save odrix/2bc6e6e0186bc1735941 to your computer and use it in GitHub Desktop.
Save odrix/2bc6e6e0186bc1735941 to your computer and use it in GitHub Desktop.
Simple change RGB Led color
#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