Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ArduinoDiscordBot/4f9b56599f797ee15ed58af933708883 to your computer and use it in GitHub Desktop.
Save ArduinoDiscordBot/4f9b56599f797ee15ed58af933708883 to your computer and use it in GitHub Desktop.
Code by Moonato#3968 - Tue Aug 13 2019 18:21:15 GMT+0000 (Coordinated Universal Time)
if(teller<=9){
digitalWrite(REDLED,LOW);
digitalWrite(GREENLED,LOW);
digitalWrite(BLUELED,LOW);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Now enter the");
lcd.setCursor(0,1);
lcd.print("same combination!");
delay(2000);
lcd.clear();
}
int temp = 0;
while(temp!=teller){
while(digitalRead(BLUEBUTTON)==LOW || digitalRead(REDBUTTON)==LOW || digitalRead(GREENBUTTON)==LOW){
if(digitalRead(REDBUTTON)==HIGH){
digitalWrite(BLUELED,LOW);
digitalWrite(GREENLED,LOW);
digitalWrite(REDLED,LOW);
lcd.clear();
lcd.setCursor(5,0);
lcd.print("RED");
digitalWrite(REDLED,HIGH);
arrayVanAntwoorden[temp]=1;
temp = temp+1;
}
if(digitalRead(GREENBUTTON)==HIGH){
digitalWrite(BLUELED,LOW);
digitalWrite(GREENLED,LOW);
digitalWrite(REDLED,LOW);
lcd.clear();
lcd.setCursor(5,0);
lcd.print("GREEN");
digitalWrite(GREENLED,HIGH);
arrayVanAntwoorden[temp]=2;
temp = temp+1;
}
if(digitalRead(BLUEBUTTON)==HIGH){
digitalWrite(BLUELED,LOW);
digitalWrite(GREENLED,LOW);
digitalWrite(REDLED,LOW);
lcd.clear();
lcd.setCursor(5,0);
lcd.print("BLUE");
digitalWrite(BLUELED,HIGH);
arrayVanAntwoorden[temp]=3;
temp = temp+1;
}
}
}
delay(2000);
checkAnswers();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment