Keyestudio 4DOF Manual page 100

Robot arm kit
Hide thumbs Also See for 4DOF:
Table of Contents

Advertisement

const int left_X = A3; //define the left X pin to A3
const int left_Y = A4; // define the left Y pin to A4
const int left_key = 8; //define the left key pin to 8(that is the value Z)
void setup()
{
pinMode(right_key, INPUT);
pinMode(left_key, INPUT);
Serial.begin(9600); // set the baud rate to 9600
}
void loop()
{
int x1,y1,z1; // define the variable, used to save the joystick value it reads
int x2,y2,z2;
x1 = analogRead(right_X); // read the value of right X
y1 = analogRead(right_Y); // read the value of right Y
z1 = digitalRead(right_key); //// read the value of right Z
x2 = analogRead(left_X); // read the value of left X
y2 = analogRead(left_Y); // read the value of left Y
// set the right/left key to INPUT
97

Advertisement

Table of Contents
loading

Table of Contents