The program for control of the manipulator of the robotic site
#include <VarSpeedServo.h>
VarSpeedServo myservo1, myservo2, myservo3, myservo4, myservo5,
myservo6; // create servo object to control a servo
void setup() { // initialize serial:
pinMode(45,OUTPUT);
pinMode(44, OUTPUT);
[Link](2,740,2365); // attaches the servo on pin 2 to the servo object
[Link](3,760,2365); // attaches the servo on pin 3 to the servo object
[Link](4,720,2365); // attaches the servo on pin 4 to the servo object
[Link](5,720,2300); // attaches the servo on pin 5 to the servo object
[Link](10,670,2300); // attaches the servo on pin 10 to the servo
object
[Link](11,720,2300); // attaches the servo on pin 11 to the servo
object
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
delay(2000);
}
void loop()
{
[Link](0,15,true);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);
[Link](0,15,false);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](50,15,false);
delay(5000);
[Link](84,15,false);
[Link](35,15,false);
[Link](12,15,false);
[Link](0,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);}
A program that will manage the work of the entire site
#include <VarSpeedServo.h>
VarSpeedServo myservo1, myservo2, myservo3, myservo4, myservo5,
myservo6;
void setup() {
pinMode(45,OUTPUT);
pinMode(44, OUTPUT);
[Link](2,740,2365); // attaches the servo on pin 2 to the servo object
[Link](3,760,2365); // attaches the servo on pin 3 to the servo object
[Link](4,720,2365); // attaches the servo on pin 4 to the servo object
[Link](5,720,2300); // attaches the servo on pin 5 to the servo object
[Link](10,670,2300); // attaches the servo on pin 10 to the servo
object
[Link](11,720,2300); // attaches the servo on pin 11 to the servo
object
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
delay(2000);
}
void loop()
{
[Link](0,15,true);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);
[Link](0,15,false);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](50,15,false);
delay(5000);
[Link](84,15,false);
[Link](35,15,false);
[Link](12,15,false);
[Link](0,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);}
while (analogRead(A1)>750)
{
digitalWrite(44,HIGH);
digitalWrite(45,LOW);
}
else{
digitalWrite(44,LOW);
digitalWrite(45,LOW); //45 - вліво
delay(5000);
}
Program code with lock function
#include <VarSpeedServo.h>
VarSpeedServo myservo1, myservo2, myservo3, myservo4, myservo5,
myservo6;
void setup() {
pinMode(45,OUTPUT);
pinMode(44, OUTPUT);
attachInterrupt(digitalPinToInterrupt(21),servoStop,RISING);
[Link](2,740,2365); // attaches the servo on pin 2 to the servo object
[Link](3,760,2365); // attaches the servo on pin 3 to the servo object
[Link](4,720,2365); // attaches the servo on pin 4 to the servo object
[Link](5,720,2300); // attaches the servo on pin 5 to the servo object
[Link](10,670,2300); // attaches the servo on pin 10 to the servo
object
[Link](11,720,2300); // attaches the servo on pin 11 to the servo
object
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
[Link](0,35,false);
delay(2000);
}
void loop()
{
[Link](0,15,true);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);
[Link](0,15,false);
[Link](44,15,false);
[Link](0,15,false);
[Link](35,15,false);
[Link](0,15,false);
[Link](50,15,false);
delay(5000);
[Link](84,15,false);
[Link](35,15,false);
[Link](12,15,false);
[Link](0,15,false);
[Link](0,15,false);
[Link](0,15,false);
delay(5000);}
while (analogRead(A1)>750)
{
digitalWrite(44,HIGH);
digitalWrite(45,LOW);
}
else{
digitalWrite(44,LOW);
digitalWrite(45,LOW); //45 - вліво
delay(5000);
}
void servostop(){
[Link]();
[Link]();
[Link]();
[Link]();
[Link]();
[Link]();
}