]
/*! * @file PenguinROBOT.ino * @copyright [DFRobot]([url=http://www.dfrobot.com]http://www.dfrobot.com[/url]), 2017 * * @author [sc.mingyang] * @version V1.0 * @date 2017-07-7 */ #include Servo myservo; void setup() { pinMode(3,OUTPUT); pinMode(5,OUTPUT); myservo.attach(2); digitalWrite(3,LOW); digitalWrite(5,HIGH); } void loop() { for(int x=1; x<10; x++) { myservo.write(75); //[/b][b]experimental result[/b][b] delay(500); myservo.write(135); delay(500); myservo.write(115); delay(500); myservo.write(115); delay(500); } myservo.write(75); //Turn right delay(3000); myservo.write(135);//Turn left delay(3000); myservo.write(105); // Go straight delay(8000); }