
Create servo object to control a servo.#include Servo Servo_0 Servo Servo_1 Servo Servo_2 Servo Servo_3 Īfter defining the function of driving the servos, we need to read the AD value of the potentiometers and convert it into the rotating angle of the servo since the servos are controlled by rotating the potentiometers. Since the Rollarm has four servos acting as the moving joint, we need to include a header file for driving the servos and define them. In other words, spin the white potentiometer to control the uppermost servo, the yellow to control the next servo below, the orange to control the next servo, and the red one to control the bottom servo. The 4 servos from top to bottom are connected to port 4-7 respectively of the expansion board, and the 4 potentiometers control the ports accordingly. There are four potentiometers to control the arms. The program includes three parts: rotating the potentiometers to control the Rollarm, pressing the button slightly for less than one second to record Rollarm’s behaviors and pressing the button for a relatively longer time to make Rollarm repeat the recorded steps.
#DIY ARDUINO ROBOTIC ARM KIT CODE#
Thus we can make it automatically carry blocks continuously: 6.3 Code Explanation So it will repeat the recorded steps (Rollarm can record at most 100 steps because of the control board’s memory limit). When all the steps are done, press and hold the yellow button for a while (3s). Rotate one potentiometer button to control one servo to the desired position, and press the yellow button shortly to let the control board record this step. With the handle, the Rollarm can record its behaviors: Step 4: Rotate the four potentiometer buttons in different colors to try the controlled servo and direction: the white button to control the Servo 4, the yellow to Servo 3, the orange to Servo 2, and the red one to control Servo 1.

Step 3: After the code upload, turn the power switch on, then we can try to control the Rollarm. Step 2: Select the corresponding board and port, then click Upload. When you open the main program, the subprograms will be opened automatically: Rollarm.ino is the main program, when the others are subprograms.


There are four code files in Rollarm, and you need to double-click Rollarm to open the four simultaneously. Step 1: Run the Rollarm.ino file under the path DIY Control Robot Arm kit for Arduino-Rollarm\ Arduino Code. The detailed operations for two ways are as follows.
#DIY ARDUINO ROBOTIC ARM KIT MANUAL#
There are two ways to control the Rollarm: manual control (by handle), or PC control (by Labview).
