BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Apr 24, 2018 3:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Leg timer not using hservotime
PostPosted: Mon Oct 18, 2010 10:42 pm 
Offline
New User

Joined: Tue Sep 14, 2010 4:55 pm
Posts: 2
;turns on light for 4 seconds

Using an Atompro ARC32 I am working on a project where a submarine has to follow different headings for different amounts of time. I have been using hservotime to accomplish this but I don't believe it can be set to zero and I am afraid if the clock resets, my timing would be wrong.

Is there a way to reset the clock or is there a better way to run a timer. Below is what I have been using

enablehservo2

starttime var long
stoptime var long
leg var long
time con 4

main
leg = time *20000000
high p44
starttime = hservotime 0 ;get current time
do
stoptime = (hservotime 0)-starttime
while stoptime < leg

low p44


Top
 Profile  
 
 Post subject: Re: Leg timer not using hservotime
PostPosted: Tue Oct 19, 2010 5:07 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The way you are doing it is the correct way to use hservotime. It seems to me you should be able to use the hservo speed argument in conjunction with the hservostate or hservowait commands. Provide a little more detail of what you are trying to do and I can probably help you.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO