Skip to content

Instantly share code, notes, and snippets.

@acetousk
Created April 10, 2019 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acetousk/e208d36445428aee0502cd1fbe2cd90c to your computer and use it in GitHub Desktop.
Save acetousk/e208d36445428aee0502cd1fbe2cd90c to your computer and use it in GitHub Desktop.
controller deadzone verify
int leftJoyVerify(){
static int count;
if(((Controller1.Axis4.value()*Controller1.Axis4.value())/37.5)+37.5<=Controller1.Axis3.value())
count++;
if((-(Controller1.Axis4.value()*Controller1.Axis4.value())/37.5)-37.5<=Controller1.Axis3.value())
count++;
if(((Controller1.Axis3.value()*Controller1.Axis3.value())/37.5)+37.5<=Controller1.Axis4.value())
count++;
if((-(Controller1.Axis3.value()*Controller1.Axis3.value())/37.5)-37.5<=Controller1.Axis4.value())
count++;
if(count==1){
return 1;
}else{
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment