Created
October 13, 2015 13:43
-
-
Save hugs/b81f0a34edd436cdf796 to your computer and use it in GitHub Desktop.
If Dancebot were a football referee... https://github.com/hugs/dancebot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
Servo head; | |
Servo leftArm; | |
Servo rightArm; | |
int headPosition = 90; | |
int leftArmPosition = 90; | |
int rightArmPosition = 90; | |
void setup() { | |
head.attach(9); | |
head.write(headPosition); | |
leftArm.attach(10); | |
leftArm.write(leftArmPosition); | |
rightArm.attach(11); | |
rightArm.write(rightArmPosition); | |
delay(2000); | |
} | |
void loop() { | |
leftArmPosition = 0; | |
leftArm.write(leftArmPosition); | |
rightArmPosition = 180; | |
rightArm.write(rightArmPosition); | |
delay(2000); | |
leftArmPosition = 180; | |
leftArm.write(leftArmPosition); | |
rightArmPosition = 0; | |
rightArm.write(rightArmPosition); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment