Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
thepersonwhobuild
Created July 16, 2021

Iron man bionic arm

iron man arm made in real with arduino

IntermediateShowcase (no instructions)34
Iron man bionic arm

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
i deafaut was building with arduino nano but it is not working
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
I used mg90s
×1
Analog joystick (Generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

CODE

C/C++
#include <Servo.h>

Servo myservo;  // create servo object to control a servo

int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}

Credits

thepersonwhobuild
3 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.