"TargetHeading" ranges from 0 to 360
"Heading" ranges from -180 to +180
No wonder all my previous "TargetHeading - Heading" programs didn't work, and I had to add an extra clause to make sure these commands work as intended...
At this stage I'm not even sure if I should suggest changing it, because a lot of my devices currently under development is already adjusted against this issue....
Any ideas on how to solve this, everyone?
@WNP78 ah, no wonder it didn't work when I tried.
Thanks.
@vcharng nope, it's documented as:
deltaangle(a, b)
- The shortest angle delta between angles a and b in degrees.So do
deltaangle(TargetHeading, Heading)
@WNP78 As in "deltaAngle(TargetHeading - Heading)"?
You can use the
deltaAngle(
function that will always give a value between -180 and 180Actually, I just found out that the remedial clause of the program works even if this is fixed. The remedial clause simply don't get activated at all....
So perhaps, fix it please?