Skip to main content
lineize state list
Source Link

If button is pressed: Motor A and B move for 1 second at slow speed == > Motor A keep moving but at fast speed and motor B stop. else: Motor A and B both stop.

I would do a quick state machine:

STATE / button released: do nothing; STATE / button pressed: run motors a+b; STATE / run motor a+b: run motor a+b; if 1 second has passed, advance to just run motor a; STATE / run motor a: run motor a at fast speed and stop motor b.

STATE / button released: do nothing;
STATE / button pressed: run motors a+b;
STATE / run motor a+b: run motor a+b; if 1 second has passed, advance to just run motor a;
STATE / run motor a: run motor a at fast speed and stop motor b.

fairly easy to code as well.

If button is pressed: Motor A and B move for 1 second at slow speed == > Motor A keep moving but at fast speed and motor B stop. else: Motor A and B both stop.

I would do a quick state machine:

STATE / button released: do nothing; STATE / button pressed: run motors a+b; STATE / run motor a+b: run motor a+b; if 1 second has passed, advance to just run motor a; STATE / run motor a: run motor a at fast speed and stop motor b.

fairly easy to code as well.

If button is pressed: Motor A and B move for 1 second at slow speed == > Motor A keep moving but at fast speed and motor B stop. else: Motor A and B both stop.

I would do a quick state machine:

STATE / button released: do nothing;
STATE / button pressed: run motors a+b;
STATE / run motor a+b: run motor a+b; if 1 second has passed, advance to just run motor a;
STATE / run motor a: run motor a at fast speed and stop motor b.

fairly easy to code as well.

Source Link
dannyf
  • 2.8k
  • 11
  • 13

If button is pressed: Motor A and B move for 1 second at slow speed == > Motor A keep moving but at fast speed and motor B stop. else: Motor A and B both stop.

I would do a quick state machine:

STATE / button released: do nothing; STATE / button pressed: run motors a+b; STATE / run motor a+b: run motor a+b; if 1 second has passed, advance to just run motor a; STATE / run motor a: run motor a at fast speed and stop motor b.

fairly easy to code as well.