Thanks for your help nick, however, this isnt the problem that we have. A
lot of the problems that you spoke of are actually a feature of IC that we
are taking advantage of. Interactive C contains libraries of commands that
you can call such as init_expbd_servos(int) and start_process(function) that
you can use to do different things.
It's a good idea to declare functions before using them (i.e.
include a prototype)
See above
Two more functions called without a declaration.
Furthermore note that this calls direction() and passes its
return value into start_process() as it's parameter value.
The significance of this will be apparent later.
I understand the point that you are making with the passing of values.
However, the start_process command begins multitasking within the Handyboard
processor so that you may have 2 functions sharing processor time and
running concurrently. Usualy this type of command would pass the result of
direction to start_process, but in this case it begins a multitask of
direction and main.
OK. So direction() doesn't return a value. This makes the
call to direction() an error.
See above, the call to direction starts multitasking, not return an int
value
And direction() itself is an infinite loop! Therfor your
program will never get as far as the call to start_process().
See above again, the infinite loop is required so that the multitask is
maintained. Once the process is started, the main task continues so this
will not cause a problem in the HB.
I have to make a guess here that maybe the line in main()
should have read:
start_process(direction);
This calls start_process() and passes as the parameter value the
address of the function direction().
If you include valid prototypes for all the functions you call this
would have been immediately obvious. It should also point you to
several instances of mis-matched parameter types that are in your
code.
The prototypes are all included in libraries, so you do not have to create
these functions yourself. Similarly, with the example you used, I believe
the parameters are matched correctly (IC is able to debug this anyway).
Thankyou for your help nick, but I do not believe that this is the problem.
Do you have any other ideas?
TIA
Jeff