To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 1666
1665  |  1667
Subject: 
Re: Turning the RCX off and on again (was: New pbForth 2.1.0 (and firmware speed))
Newsgroups: 
lugnet.robotics.rcx.pbforth, lugnet.robotics.rcx
Date: 
Thu, 11 Apr 2002 13:45:33 GMT
Viewed: 
1629 times
  
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:
  RE: Turning the RCX off and on again (was: New pbForth 2.1.0 (and firmware speed))
 
I need to look at some items for Joerg, but I'll also look at a small supervisor that integrates the View,Run,Prgm,and On/Off buttons. This hsould be pretty easy and would be a good bit of example code. Cheers, Ralph (23 years ago, 11-Apr-02, to lugnet.robotics.rcx.pbforth, lugnet.robotics.rcx)

9 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR