33Views0Replies

Author Options:

Arduino robotic arm Answered

hi, I just made a 5 DOF robotic arm and its not working for some reason I'm not sure whether if its the code problem or the mechanical part of the robot

here's the Arduino code:

#include
#include Servo servo1;

Servo servo2;

Servo servo3;

Servo servo4;

Servo servo5;

Servo servo6;

int bluetoothTX = 11;

int bluetoothRX = 12;

SoftwareSerial bluetooth(bluetoothTX, bluetoothRX);

void setup()

{ // put your setup code here, to run once:

servo1.attach(3);

servo2.attach(4);

servo3.attach(5);

servo4.attach(6);

servo5.attach(7);

servo6.attach(8);

Serial.begin(9600);

bluetooth.begin(9600);

}

void loop() {

// put your main code here, to run repeatedly:

if(bluetooth.available()>0)

{

int servopos1 = bluetooth.read();

int servopos2 = bluetooth.read();

int servopos3 = bluetooth.read();

int servopos4 = bluetooth.read();

int servopos5 = bluetooth.read();

int servopos6 = bluetooth.read();

Serial.println(servopos1);

Serial.println(servopos2);

Serial.println(servopos3);

Serial.println(servopos4);

Serial.println(servopos5);

Serial.println(servopos6);

servo1.write(servopos1);

servo2.write(servopos2);

servo3.write(servopos3);

servo4.write(servopos4);

servo5.write(servopos5);

servo6.write(servopos6);

}

}

Tags:help

Discussions