Skip to content

Commit

Permalink
rearrange some comments to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
JJTech0130 committed Jan 20, 2024
1 parent 5a4505e commit 30f6358
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ private class ServoCounter extends Thread {
private int count = 0;

public void run() {
android.util.Log.w("AXON_THREAD", "Starting thread");
double lastPosition = getCurrentPosition();
while (true) {
android.util.Log.w("AXON_THREAD", "LOOP");
//android.util.Log.w("AXON_THREAD", "LOOP");
double currentPosition = getCurrentPosition();
// Negative wrap-around from 360 -> 0
// Positive wrap-around from 0 -> 360
if (currentPosition > 180 && lastPosition < 180 && innerServo.getPower() > 0) {
count--;
}
// Positive wrap-around from 0 -> 360
// Negative wrap-around from 360 -> 0
if (currentPosition < 180 && lastPosition > 180 && innerServo.getPower() < 0) {
count++;
}
Expand Down

0 comments on commit 30f6358

Please sign in to comment.