Go to file
2016-03-03 00:11:22 +01:00
box ok 2016-03-03 00:11:22 +01:00
electronics ok 2016-03-03 00:11:22 +01:00
README.md ok 2016-03-03 00:11:22 +01:00

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.