|
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)
|