NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <Servo.h>

Servo servo1,servo2,servo3,servo4,servo5; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position
int posC = 110;
//int pos3 = 50;
void setup() {

servo1.attach(8);
servo2.attach(9); // attaches the servo on pin 9 to the servo object
servo3.attach(10);
servo4.attach(11);
servo5.attach(12);
}

/*void loop(){
//myservo.write(pos);
//delay(1000);
myservo.write(pos2);
delay(1000);
myservo.write(pos3);
delay(1000);
}*/
void loop() {
funOpen1();delay(500);
funOpen2();delay(500);
funOpen3();delay(500);
/*delay(2000);
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}*/
}
// All Open At ONCE

int allOpen() {
servo1.write(pos);
servo2.write(pos);
servo3.write(pos);
servo4.write(pos);
servo5.write(pos);
}

// All Open At ONCE

int allClose() {
servo1.write(posC);
servo2.write(posC);
servo3.write(posC);
servo4.write(posC);
servo5.write(posC);
}

// FUNCTION TO OPEN THE FINGURE INDIVIDUALLY
int funOpen1(){
for (pos = 0; pos <= 110; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servo1.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funOpen2(){
for (pos = 0; pos <= 110; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servo2.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funOpen3(){
for (pos = 0; pos <= 110; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servo3.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funOpen4(){
for (pos = 0; pos <= 110; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servo4.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funOpen5(){
for (pos = 0; pos <= 110; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servo5.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
//END FUNCTION TO OPEN FINGURE INDIVIDUALLY

//FUNCTIONS TO CLOSE INDIVIDUAL FINGURE
int funClose1(){
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
servo1.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funClose2(){
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
servo2.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funClose3(){
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
servo3.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funClose4(){
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
servo4.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
int funClose5(){
for (pos = 110; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
servo5.write(pos); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
}
//InDIVIDUAL CLOSE CUNCTION END HERE

//Gestures Coading STARTS HERE

//Peace Function Code Start
funPeace(){
int allClose(); delay(200);
int funOpen3(); delay(200);
int funOpen4(); delay(2000);
int allClose();
}


//ROCK Function Code Start
funRock(){
int allClose(); delay(200);
int funOpen1(); delay(200);
int funOpen4(); delay(200);
int funOpen5(); delay(2000);
int allClose();
}


//Peace Function Code Start
funPeace(){
int allClose(); delay(100);
int funOpen3(); delay(200);
int funOpen4(); delay(2000);
int allClose();
}


//Peace Function Code Start
funPeace(){
int allClose(); delay(100);
int funOpen3(); delay(200);
int funOpen4(); delay(2000);
int allClose();
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.