|
For the Workshop3D Event I use the following construct, the button handling
is from the book "Extreme Mindstorms":
: main ( -- ) \ Main Task
init \ do main initialize
( ... )
BEGIN
( ... )
BUTTON_SCAN BUTTON_RUN?
IF
( ... ) \ Calibrating
BEGIN
( ... ) \ Bot Main Loop
\ ask run button
BUTTON_SCAN BUTTON_RUN?
UNTIL
\ motors off
0 breaking leftM MOTOR_SET
0 breaking rightM MOTOR_SET
THEN
BUTTON_ON?
IF
quit \ here goes the Brick to Sleep
\ and awakes here too
init
\ EXIT \ comment out if you want to go to Console
THEN
AGAIN
;
The word quit make some things and calls POWER-OFF.
With this words you can handle the RCX only with buttons.
But I think too a "supervisor" in the ForthSystem would be a good completion.
Cheers
Joerg
|
|
Message is in Reply To:
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|