Go Down

Topic: Pause a robot (Read 1 time) previous topic - next topic


I am trying to find a way to pause a robot using a pause button, and be able to return the robot back to what it was doing before, using either the same button or another one.
Is there a program I could write or copy and paste into my robot program in my arduino board to help me do this.
Any help will be appreciated.


Jun 13, 2014, 06:50 pm Last Edit: Jun 13, 2014, 06:52 pm by JimboZA Reason: 1
This might work, stuck into loop() at an appropriate spot.

Code: [Select]
while(digitalRead(pauseButton))   //true if pauseButton is HIGH
 // do nothing

But that means the button needs to be kept pressed, so a toggle switch would be better. Then just flick it back to un-pause.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0


Go Up