Subject:
|
Allowing VC to select slot number for alternate program
|
Newsgroups:
|
lugnet.robotics, lugnet.robotics.vc
|
Date:
|
Fri, 29 Dec 2000 20:49:05 GMT
|
Viewed:
|
4534 times
|
| |
| |
For those of you who are tinkering with running alternate language programs
from VC, Dean Husby suggested that you can add a little more flexibility
with another modification. Modify the SpinLeft macro as shown below to allow
you to select the slot number from within VC. With the modification, you
select slot number by entering .1s in the SpinLeft command for slot 1, .2s
for slot 2, .3s for slot 3, and .4s for slot 4. Slot 5 already has the VC
program so it doesn't make sense to jump to that. You will notice that VC
actually passes .1s as the value 10 etc. Longer times will ignore the whole
slot jumping process and the SpinLeft command behaves like it did
originally.
Modified bb_SpinLeft Macro:
macro bb_SpinLeft(nLeft, nRight, nTime) {
select nTime{ // The following lines check the value of nTime and jump to
the appropriate slot.
when 10 {slot 1}
when 20 {slot 2}
when 30 {slot 3}
when 40 {slot 4}
}
dir nRight nLeft
on [nLeft nRight]
wait nTime
float [nLeft nRight]
}
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|