Cockpitbuilders.com
Arduino Projects => General Discussions => Topic started by: RayS on May 08, 2015, 07:53:08 PM
Hoping this works for Arduino compass code...
Any flowchart junkies wanna take a swing at it to see if I'm on the right track?
2 assumptions:
1. The stepper motor will never lag more than 120 degrees behind the real AC heading
2. Two 'Zones' are tested first. If neither condition is true, then inc/dec normally
I am in no position to evaluate the compass logic, but I think your flow chart is missing what happens for "NO"on the "Is compass Heading < 0" and "Is compass heading >359".
Hi Ray,
Why not just program to operate like sioc does. My HSI compass card works great with it. You would need to adjust the numbers to match your steps.
{
L0 = V0015 + 1460 // Add 146 degree for my gauge center
IF L0 > 3600 // If is > 360 degree discount a full turn
{
L0 = L0 - 3600
}
V0000 = L0 // send degrees to steper motor
}
Rob
Hey Ray,
Any success on your arduino compass code?
Rob