I am working on a sailboat autopilot using a 28X1 and with a CMPS03 I2C Compass. In Pseudo code my program looks like this :-
' wait for auto button to be pressed
' make set point equal to current compass reading
' ###############
'auto_loop:
'start timer
'get compass reading and turn rate from compass subroutine
'compare with set point and calculate correction
'make correction
'output data to ???
'wait for total loop time
'goto auto loop
I am keen to keep the time through the loop constant and plan to do this with the timer function, simply waiting at the end of the loop until a preset time is reached before intiating the next pass.
To help diagnostics and control I would like to somehow log the key data at each pass through the loop with a view to analysing performance on a PC later. Each pass will generate about 10 bytes and ideally I would like to record at least 20 passes though more would be better. Is it possible to use Hippys Capture.exe program or will that disturb the timer operation ?
Â
' wait for auto button to be pressed
' make set point equal to current compass reading
' ###############
'auto_loop:
'start timer
'get compass reading and turn rate from compass subroutine
'compare with set point and calculate correction
'make correction
'output data to ???
'wait for total loop time
'goto auto loop
I am keen to keep the time through the loop constant and plan to do this with the timer function, simply waiting at the end of the loop until a preset time is reached before intiating the next pass.
To help diagnostics and control I would like to somehow log the key data at each pass through the loop with a view to analysing performance on a PC later. Each pass will generate about 10 bytes and ideally I would like to record at least 20 passes though more would be better. Is it possible to use Hippys Capture.exe program or will that disturb the timer operation ?
Â