Skip to content

Instantly share code, notes, and snippets.

@pmarkun
Created October 23, 2014 17:17
Show Gist options
  • Select an option

  • Save pmarkun/52f9c7dc8f1c8c583e76 to your computer and use it in GitHub Desktop.

Select an option

Save pmarkun/52f9c7dc8f1c8c583e76 to your computer and use it in GitHub Desktop.
/*
JoystickDuino
*/
int cima = 1;
int baixo = 2;
int esq = 3;
int dir = 4;
int soco_baixo = 5;
int soco_medio = 6;
int soco_alto = 7;
int chute_baixo = 8;
int chute_medio = 9;
int chute_alto = 10;
int start = 11;
int select = 12;
void setup() {
pinMode(cima, INPUT);
pinMode(baixo, INPUT);
//etc
}
void loop() {
if (analogRead(cima) == HIGH) {
Keyboard.press(KEY_UP_ARROW);
delay(10);
}
//etc
//da forma como esta o codigo
//fica apertando infinitamente o botao
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment