Hi Guys,
I am hoping someone can help me. I am trying to use hservotime on my ARC32 however it just seems to return zero when I call it. To try it out I have the following code which was pretty much lifted from the ARC32 datasheet.
Code:
ENABLEHSERVO2
sethserial1 H38400
starttime var long
stoptime var long
main
starttime = hservotime 0 ;get current time
do
stoptime = (hservotime 0)-starttime
hserout ["Start Time = ", dec starttime, " : Stop Time = ", dec stoptime, 13]
while stoptime < 10000000
hserout ["Time (usec) = ", dec (stoptime-starttime)/2, 13]
toggle p44
goto main
I seem to get stuck in the loop as stoptime = 0. The first hserout prints the following continuously...
Code:
Start Time = 0 : Stop Time = 0
So am I doing something wrong and if so what?
I am using Basic Micro Studio 2.0.0.8 although this was the same with 2.0.0.7
Any help would be much appreciated.
Thanks
iain