Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#define Rouge A0
#define Vert A1
#define Bleu A2
int message = 0;
int couleurs[] = {Rouge, Vert, Bleu};
void setup() {
Serial.begin(9600);
pinMode(Rouge, OUTPUT);
pinMode(Vert, OUTPUT);
pinMode(Bleu, OUTPUT);
}
void loop() {
if (Serial.available()) {
message = Serial.read() - '0';
if (message > 3) {
digitalWrite(couleurs[message-4], LOW);
}
else {
digitalWrite(couleurs[message-1], HIGH);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.