Thanks Joe!!!
That compass sounds exactly like the device I need!!!
If you've a problem with the shockwave player, try it on Firefox - or downloand the Flash player. But in all honesty I can't get it
NOT to work.
Meanwhile, what I'm trying to achieve ... a couple of definitions first:
Heading - the angle of the ship's course from north, measured in degrees, clockwise from zero.
Relative bearing - an angle from the bow, measured in degress, clockwise from zero.
So ... a dose of pseudo code:
1/ During a sail, at some point I set the target's
relative bearing on the TX.
green 060, for example, while due to my bizarre rudder control I've ended up steaming NW (315 degrees).
2/ Using the compass, the microprocessor turns this relative bearing into a true
heading. (Hey - target is 15 degrees East of North)
3/ When the turrets are set to "acquire" on the TX, they'll train to this relative bearing, if they can see it - if they can't see it, they'll stay parked or return to park.
Now the loop:
4/ As and when the ship's heading changes, the relative bearing gets updated, and the turrets can then track the target, or park, or acquire the target from parked positions as and when necessary.
The loop ends when the turrets are set to "fire" or "park" as decided by the TX.
Perfect!!!
The coding's a doddle using <£50 microprocessors - it really is. And the loop can occur hundreds of times a second without any trouble, meaning that the "following" of a target can appear constant.
Now, if only the attic would warm up and let me plank my decks again! I've still got a pile to do...
Many thanks,
Andy #1963#