Skip to content

Instantly share code, notes, and snippets.

@Drunkar
Created April 22, 2017 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drunkar/3297c8c7b6f784a1b05235e856243763 to your computer and use it in GitHub Desktop.
Save Drunkar/3297c8c7b6f784a1b05235e856243763 to your computer and use it in GitHub Desktop.
// https://github.com/netlabtoolkit/VarSpeedServo
#include <VarSpeedServo.h>
VarSpeedServo myservo1;
VarSpeedServo myservo2;
VarSpeedServo myservo3;
void setup() {
myservo1.attach(9);
myservo2.attach(10);
myservo3.attach(11);
}
void loop() {
// pick up
myservo1.write(85, 30, true);
myservo2.write(0, 30, true);
//myservo3.write(90, 30, true); // open
delay(500);
myservo3.write(140, 30, true); // close
// rotate 90 degrees
myservo2.write(45, 30, true);
myservo1.write(0, 30, true);
// put on
myservo2.write(0, 30, true);
myservo3.write(90, 30, true); // open
myservo2.write(45, 30, true);
delay(2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment