0

I've been trying to make a menu that when you press the < button on the block it will start and > to stop. The menu wil only occur at the start also, it will not be ongoing. I've attempted to use the Switch block but it always goes to the default case and I can't make it into 2 options, begin the program and stop.

Any help would be much appriecated.

  • 2
    Welcome Rean. Please add a printout of your best try (the one with the Switch block) and if possible, provide more details as to where in this program you have an issue. – Phil B. Oct 29 '16 at 11:49
1

The brick buttons are a bit tricky.

In pseudocode:

  • Wait for "<" button to be pressed and released
  • Run a program that leaves the motors running.
  • Wait for ">" button to be pressed
  • Stop the motors

Wait for Brick Buttons to be pressed.

The tricky parts:

  • which mode of the wait for block
  • which button to watch
  • button being pressed vs bumped
  • ignoring the extra section of the wait for block

And finally there is the possibility that the desire was to provide an option to stop the program at any time while it was running, not just at the end of the program to stop running motors. That is a much different problem for which this example only hints at a solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy