Fix calculation of brearing
This commit is contained in:
parent
ef0845096e
commit
363c791ef1
|
|
@ -109,7 +109,7 @@ bool doHttpRequest(char *payload, char *latitude, char *longitude, char *gpsTime
|
|||
}
|
||||
|
||||
byte calculateBearing(float bearing) {
|
||||
int relativeAngle = (int)(bearing - (360 - compass.getAzimuth()));
|
||||
int relativeAngle = (int)(bearing - compass.getAzimuth());
|
||||
relativeAngle += 360;
|
||||
relativeAngle %= 360;
|
||||
return compass.getBearing(relativeAngle);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user