
118 Make: Robotic Arms
int myMatrix[3][3] = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
In our project, we want to create a 4 x 2 matrix.
We’ll need four rows to hold the four sets of
coordinate points to make our square, and each
row will need two columns: one for our x value
and one for our y value. Let’s look at our previous
code example and remix it to include multiple
coordinate points within a matrix.
STEP 1: DRAWING A SQUARE WITH OUR
ROBOTIC ARM
#include "Servo.h"
Servo servoOne;
Servo servoTwo;
double x = 30.0;
double y = 120.0;
double linkOne = 100.0;
double linkTwo = 100.0;
double alphaOne;
double alphaTwo;
double alphaFinal;
double betaOne;
double betaTwo; ...