View Single Post
  #7   Spotlight this post!  
Unread 05-01-2003, 20:23
nwagers nwagers is offline
Registered User
#0240 (Mach Vee)
 
Join Date: Oct 2001
Location: Monroe, MI
Posts: 88
nwagers is an unknown quantity at this point
Send a message via AIM to nwagers Send a message via Yahoo to nwagers
I agree... use the optical sensors. If you've ever used the lego robots you know that using time as a guide it is very inconsistent. Something as simple as battery voltage can throw you off by a few feet. You can easily practice by attaching 2 optical sensors to a board and have 2 LEDS representing left and right turns. If you do decide to use the time as a guide may I suggest using delta_t (missed packets since last "serin" line) as well

mainloop:
serin
time = time + 1 + delta_t

select case time

0 to x
run motor
x to y
next step
and so on...

endselect

serout
goto mainloop

there are supposedly some new programming commands this year, it should simplify the code. Remember to declare time big enough to handle the amount of time you need (a byte is about 6 secs, a word is about 27mins)