hello,
I am a beginer in electronics and arduino, we are working on a school project and have a problem and don`t seem be able to fix it:
We have built a robotic arm, it works but at startup it twitches … a lot.
I will post a short video clip of this , afterwords it seems to be working fine.
Details:
yes I have an initial position set for every servo.
arduino mega.
a pc power suply for the arduino and the robotic arm.
Code:
this is in a header file:
#include <Servo.h>
#include <SoftwareSerial.h>
#define servoTopPin 7
#define servo2Pin 11
#define servo3Pin 8
#define servo4Pin 9
#define servoClawDirPin 10
#define servoClawPin 12
my setup function:
servoTop.write(defaultServoVal[0]);
servo2.write(defaultServoVal[1]);
servo3.write(defaultServoVal[2]);
servo4.write(defaultServoVal[3]);
servoClawDir.write(defaultServoVal[4]);
servoClaw.write(defaultServoVal[5]);
where defaultservopos is an array of values , for the initial position.
I also have another function init servos
servoTop.attach(servoTopPin);
servo2.attach(servo2Pin);
servo3.attach(servo3Pin);
servo4.attach(servo4Pin);
servoClawDir.attach(servoClawDirPin);
servoClaw.attach(servoClawPin);
Tried diffrent versions , calling the functions in the loop (once) , in setup …
same result.
Please advice me, again I would like to point out that I am a beginer.
Thanks
Video : https://streamable.com/7ggyf