buttonMove

buttonMove

Using the inputBox we can move the robot using buttons.

Commands Used

robotActivate();

robotJog(x,y);

inputBoxActivate();

buttonRead(x);

buttonMove.ino


Cut and paste code:

#include <robot.h>
#include <robotInputs.h>

void setup() {
  robotActivate();    //start communication with the robot
  inputBoxActivate(); //start communication with the inputBox

}

void loop() {
  if (readButton(1)) robotJog(3, 1);   //if top button pressed, move up
  if (readButton(2)) robotJog(1, -1);  //if left button pressed move left
  if (readButton(3)) robotJog(1, 1);   //if right button pressed move right
  if (readButton(4)) robotJog(3, -1);  //if bottom button pressed move down
}