\ BUTTONTEST.TXT - Improved button processing problem

HEX

: TEST_BUTTON
  RCX_INIT
  1 4003 SOUND_PLAY   \ Beep-beep

\ Wait for RUN button press to start
  BEGIN
    BUTTON_SCAN BUTTON_RUN?
  UNTIL
  3 4003 SOUND_PLAY   \ Upward tones
  
  \ Wait for RUN button press to stop
  BEGIN
    \ Code inside loop goes here
    BUTTON_SCAN BUTTON_RUN?
  UNTIL
  2 4003 SOUND_PLAY ;  \ Downward tones

