Ethan
Published © LGPL

Robot Arm 2000

A robot arm that can be used to grab small objects.

BeginnerShowcase (no instructions)1,638
Robot Arm 2000

Things used in this project

Hardware components

Rotary potentiometer (generic)
Rotary potentiometer (generic)
×4
Servos (Tower Pro MG996R)
×4
Arduino UNO
Arduino UNO
×1

Software apps and online services

MATLAB
MATLAB
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Arduino Code

C/C++
int pot1=A1;
int pot2=A2;
int pot3=A3;
int pot4=A4;
#include <Servo.h>
int val1;
int val2;
int val3;
int val4;
Servo myservo1;
Servo myservo2;
Servo myservo3;
Servo myservo4;


void setup() {
  // put your setup code here, to run once:
myservo1.attach(9);
myservo2.attach(10);
myservo3.attach(11);
myservo4.attach(12);
}

void loop() {
  // put your main code here, to run repeatedly:
 val1 = analogRead(pot1);    
 val1 = map(val1, 0, 1023, 0, 180);
 myservo1.write(val1);   

 val2 = analogRead(pot2);    
 val2 = map(val2, 0, 1023, 0, 180);
  myservo2.write(val2);

 val3 = analogRead(pot3);    
 val3 = map(val3, 0, 1023, 0, 180);
  myservo3.write(val3);

   val4 = analogRead(pot4);    
 val4 = map(val4, 0, 1023, 0, 180);
  myservo4.write(val4);
}

Credits

Ethan

Ethan

12 projects • 2 followers
Welcome to my page! I use this site to record my personal projects. Email me at ethan.peng20@gmail.com if you have any questions.
Thanks to daGHIZmo.

Comments