/* SkinnerRobot by Emanuel Cesar This example code is in the public domain. modified 02 Jul 2017 by Emanuel Cesar http://www.emanuelcesar.com */ #include Servo myservo; // create servo object to control a servo Servo myservo1; // twelve servo objects can be created on most boards ( two used only ) int pos = 0; // variable to store the servo position int led = 11; // the PWM pin the LED is attached to int brightness = 0; // how bright the LED is int fadeAmount = 15; void setup() { pinMode(led, OUTPUT); myservo.attach(9); // attaches the servo on pin 9 to the servo object myservo1.attach(10); // attaches the servo on pin 10 to the servo object } void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1500); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second for (pos = 80; pos <= 560; pos += 1) { // goes from 80 degrees to 560 degrees // in steps of 1 degree myservo1.write(pos); // tell servo to go to position in variable 'pos' delay(01); // waits 1ms for the servo to reach the position } for (pos = 120; pos >= 48; pos -= 1) { // goes from 120 degrees to 48 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 10ms for the servo to reach the position } delay(2000); for (pos = 80; pos <= 560; pos += 1) { // goes from 80 degrees to 560 degrees // in steps of 1 degree myservo1.write(pos); // tell servo to go to position in variable 'pos' delay(01); // waits 1ms for the servo to reach the position } digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1500); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); delay(2000); for (pos = 120; pos >= 48; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 10ms for the servo to reach the position }}