Skip to content

Instantly share code, notes, and snippets.

@UlisesGascon
Created June 20, 2015 19:32
Show Gist options
  • Save UlisesGascon/e05963566cc229587cd2 to your computer and use it in GitHub Desktop.
Save UlisesGascon/e05963566cc229587cd2 to your computer and use it in GitHub Desktop.
pptls - Human Choice
// Definimos la eleccion del jugador y Arduino a cero.
String eleccionJugador = "vacio";
// ==== EMPIEZA EL LOOP() ====
void loop (){
// El jugador define su elección a traves de los 5 botones.
if(digitalRead(boton1) == HIGH){
eleccionJugador = "piedra";
}else if(digitalRead(boton2) == HIGH){
eleccionJugador = "papel";
}else if(digitalRead(boton3) == HIGH){
eleccionJugador = "tijeras";
}else if(digitalRead(boton4) == HIGH){
eleccionJugador = "lagarto";
}else if(digitalRead(boton5) == HIGH){
eleccionJugador = "spock";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment