Cockpitbuilders.com

Arduino Projects => General Discussions => Topic started by: RayS on May 08, 2015, 07:53:08 PM

Title: Compass Code Flowchart...
Post 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
Title: Re: Compass Code Flowchart...
Post by: quid246 on May 09, 2015, 02:12:43 PM
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".
Title: Re: Compass Code Flowchart...
Post by: 727737Nut on May 09, 2015, 06:02:10 PM
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
Title: Re: Compass Code Flowchart...
Post by: 727737Nut on October 18, 2015, 10:29:17 AM
Hey Ray,
Any success on your arduino compass code?

Rob