Keyestudio 4DOF Manual page 144

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

Advertisement

Test Code 3:
*******************************************************************************************************************************
const int right_X = A2; // define the right X pin to A2
const int right_Y = A5; // define the right Y pin to A5
const int right_key = 7; //define the right key pin to 7(that is the value Z)
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
// set the right/left key to INPUT
141

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents