Hi, im working on a mini project which focuses on counting complete turns either clockwise or counter-clockwise using a compass and I'm having problems on finding the correct algorithm for it.
This is the flow of the program...
1. Read the initial bearing from the digital compass and save it
2. In the loop, read the current bearing
3. Compare the current bearing with the initial bearing
4. If they are equal, add/subtract a count depending on the direction of turn
The problem is determining the direction of full turn on angle 359 to 0.
There's a code for determining the bearing difference for the direction of turn but this is only applicable on half turn applications.
Can anybody help me with this? Thanks!
This is the flow of the program...
1. Read the initial bearing from the digital compass and save it
2. In the loop, read the current bearing
3. Compare the current bearing with the initial bearing
4. If they are equal, add/subtract a count depending on the direction of turn
The problem is determining the direction of full turn on angle 359 to 0.
There's a code for determining the bearing difference for the direction of turn but this is only applicable on half turn applications.
Can anybody help me with this? Thanks!