Skip to content

Instantly share code, notes, and snippets.

@GuitouFlc
Created August 28, 2017 16:40
Show Gist options
  • Save GuitouFlc/f4c560a4fb077dfb01f7f52b68a0bedb to your computer and use it in GitHub Desktop.
Save GuitouFlc/f4c560a4fb077dfb01f7f52b68a0bedb to your computer and use it in GitHub Desktop.
test cligno francois
const int CG = 10
const int CD = 11
const int BG = 12
const int BD = 13
int BDState = 0
int BGState = 0
void setup() {
//CG=cligno gauche CD=...
pinMode(CG, OUTPUT);
pinMode(CD, OUTPUT);
pinMode(BG, inPUT);
pinMode(BD, inPUT);
}
void loop() {
BGState = digitalRead(BG);
BDState = digitalRead(BD);
if (BGState == HIGH) {
digitalWrite(CG, HIGH);
delay(500);
digitalWrite(CG, LOW);
delay(500)
} else {
digitalWrite(CG, LOW);
}
if (BDState == HIGH) {
digitalWrite(CD, HIGH);
delay(500)
digitalWrite(CD, LOW);
delay(500)
} else {
digitalWrite(CD, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment