Button to start and stop the robot

Which button should I buy to stop and start my robot? I would like the button to be located about 2 feet above the Arduino board. Also, what wire/connector should I buy to hook the button to my Arduino Uno? As far as the code for this goes, would I just say something like: buttonON = digitalRead(12);
if (buttonON == HIGH)
{
stop/start robot
}
What command should I give to start the robot? Would I say something like this?:
Serial.write(CMD);
Serial.write(WRITESP1);
Serial.write(155);
What command should I use to stop the robot, “dead in its tracks”?
I’m just trying to get headed in the right direction and appreciate your guidance.
Thanks, dexter5

Hello @dexter5 and welcome to the RobotShop community,

Could you tell us which robot you are referring to?

If you’re new to Arduino programming I suggest checking their tutorials:

https://www.arduino.cc/en/tutorial/button

1 Like

I am referring to my own self-designed robot…it’s basically two drives wheels up front with two caster wheels in the back. I will look at those Arduino tutorials and see if that helps. Thanks for the referral.

1 Like