Skip to content

Commit

Permalink
Fixed Vx & Vy zero values
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrappers-glitch committed Jan 9, 2021
1 parent 0f8ceca commit 8075c86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/JoystickModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,17 @@ public void startCollectingChannelsData(){
}
/*512-40=472*/
if(valueX<(neutralizeState-tolerance)){
if(valueX<=0){
valueX=100f;
}
onBackwardListener.backward((float)valueX/100f);
}
if(valueY>(neutralizeState+tolerance)){
steerRTListener.steerRT((float) (valueY/100f));
}
if(valueY<(neutralizeState-tolerance)){
if(valueX<=0){
valueX=100f;
if(valueY<=0){
valueY=100f;
}
steerLTListener.steerLT((float)valueY/50f);
}
Expand Down

0 comments on commit 8075c86

Please sign in to comment.