You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
gnieark 2751c43a52 ok 8 years ago
box ok 8 years ago
electronics ok 8 years ago
README.md ok 8 years ago

README.md

Arduino analog Joystick

Arduino's code is something like:

int joystickPin = A0; 
int getPushedButton(int joystickPin){
  int val=analogRead(joystickPin);
  if(val > 1000){
   return 0; 
  }else if (val > 650){
    return 4;
  }else if(val > 450){
   return 6; 
  }else if(val > 120){
    return 5;
  }else if(val > 45){
    return 3;
  }else if(val > 15){
   return 1; 
  }else{
   return 2; 
  }
}

Adapt limit values if you use differents resistors than mines.