यह Project बहुत पहले का बना हुआ है मेने इसे update किया है यदि बोर होते है तो सिर्फ Circuit और Programming को देखें यह बहुत काम का project है
Arduino से तीन Servo Motor Control करें
Arduino और तीनों Servo motors का Circuit बनाएं
ServoA
- पहली servo motor के Yallow wire को Arduino की pwm pin 9 से connect करें
- Red wire को Arduino 5V+ से connect करें
- Brown या Black कलर के wire को Arduino के Gnd से connect करें
इसी प्रकार
- servoB के Yallow wire को Arduino की pwm pin 4 से connect करें
- Red wire को Arduino 5V+ से connect करें
- Brown या Black कलर के wire को Arduino के Gnd से connect करें
- servoC के Yallow wire को Arduino की pwm pin 3 से connect करें
- Red wire को Arduino 5V+ से connect करें
- Brown या Black कलर के wire को Arduino के Gnd से connect करें
Sketch Arduino में upload करें
ये program servo motors को 30degree से 90degree तक घुमायेगा program loop में है तो ये चलता रहेगा आप angle,time बदल सकते है
programmer-mechanic37
www.mechanic37.com
*/#include <Servo.h>
Servo servoA; // create servo object to control a servo
Servo servoB;
Servo servoC;
void setup()
{
servoA.attach(9); // attaches the servo on pin 9 to the servo object
servoB.attach(4);
servoC.attach(3);
}
void loop()
{
servoA.write(30); // tell servo to go to position
servoB.write(30);
servoC.write(30);
delay(15);
servoA.write(90);
servoB.write(90);
servoC.write(90);
delay(10);
}
3 servos के लिए for loop program time और pwm pin ,condition आप बदल कर भी use कर सकते है pwm pin की जगह दूसरी pin भी pwm pin ही use करें
Robotic Arms के लिए इसी तरह programming करनी होती है जिससे वह set किया हुआ sequence में पर काम करती रहे
programer-mechanic37
www.mehanic37.com
*/#include <Servo.h>
Servo servoA; // create servo object to control a servo
Servo servoB;
Servo servoC;
int pos = 0; // variable to store the servo position
void setup()
{
servoA.attach(9); // attaches the servo on pin 9 to the servo object
servoB.attach(4); // attaches the servo on pin 4 to the servo object
servoC.attach(3); // attaches the servo on pin 3 to the servo object
}
void loop()
{
for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees
{
servoA.write(pos); // tell servo to go to position in variable ‘pos’
servoB.write(pos);
servoC.write(pos);
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=0; pos-=1) // goes from 180 degrees to 0 degrees
{
servoA.write(pos); // tell servo to go to position in variable ‘pos’
servoB.write(pos);
servoC.write(pos);
delay(15); // waits 15ms for the servo to reach the position
}
}
Sir robot ke leg ka video dalo aor arduino se adhiktar kitni motor control kar sakte hai kya ye wifi
work karta hai,
sir kitni ram ka ye accha hota hai