Testing limit switches:

First we will start by testing the limit switches, and ensure they are plugged in and operating properly.

Open the Arduino IDE, which is the light blue/green icon in the shortcut menu. Go to open → recent files and open the file called SwitchTest. You screen should look like this

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/af4acb5b-6f4d-4462-b752-1a46c9da626b/Untitled.png

Ensure you have the right board and port selected (Mega 2560), and then click the upload button. Open the serial monitor (magnifying glass icon in the top left). You should then see streaming data from the device. Click on each limit switch and you should see them clicking from 0 to 1 on your serial monitor output.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ddd90f54-c7ab-48a2-92ce-59f0d2c9f6f3/2021-07-15_13-25-25.mkv

Testing stepper motors:

You will now test the motors to ensure everything is wired correctly.

WARNING, THINGS ARE ABOUT TO MOVE.

Once this next sketch is loaded, the motors will start to move as soon as the board is powered.

Go back to the Arduino IDE and open the MotorTest sketch. Upload this to the board.

Next, place your robot in a neutral position, and plug in the power port. You should see each axis rotate back and forth about 20 degrees.

Next, try playing with the axis_1_move_dist, axis_2_move_dist and axis_3_move dist on lines 24-26. Change these values by a small amount, re-upload and see the change.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1110724f-d122-42e8-8bb5-7191eb9e8693/Untitled.png

Prepare the arm for teleoperation

Finally, open and upload the TeleopWithHoming sketch. We will use this in our next section with ROS.