Robotic arm 4 servos

How to control and program a 4 servos robotic arm with a 4x4 keypad

Feb 3, 2021

6884 views

1 respects

Components and supplies

1

RGB LCD Shield Kit, 16x2 Character Display

1

4x4 membrane keypad

4

SG90 Micro-servo motor

1

Solderless Breadboard Half Size

1

Arduino UNO

1

Robotic Arm Kit

1

Jumper wires (generic)

Project description

Code

Robot Arm 4 Servos controled by 4x4 kepad

arduino

Downloadable files

Robot Arm servos

Robot Arm servos

Robot Arm servos

Robot Arm servos

Comments

Only logged in users can leave comments

roger_marin

4 years ago

To avoid problems with the servos I set up an upper and lower limit to each servo, so they don try to go further than fiscally possible if (i < 50){ i = 50;}// 50 is the lower limit for the servo if (i > 120){ i = 120;} // 120 is the upper limit for the servo This is the code for servoA // For SERVO A if(leter == 'A') { if (i < 50){ i = 50;}// 50 is the lower limit for the servo if (i > 120){ i = 120;} // 120 is the upper limit for the servo angle =servoA.read(); if ( i >= angle) { for (angle = angle; angle <= i; angle=angle +1) {servoA.write(angle); delay(10); } } else { for (angle = angle; angle >= i; angle=angle- 1) {servoA.write(angle); delay(10); } } }