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
// This is the code Chris used to move his carrage | |
#include <Servo.h> | |
Servo myservo; | |
void setup() | |
{ | |
myservo.attach(5); // Attaches the servo to pin 5 | |
} | |
void loop() | |
{ | |
myservo.write(0); // When a cont. Servo is assigned the value 0 | |
// it will move to the left at max speed | |
delay(2100); | |
myservo.write(90); // 90 will stop a continuous motor | |
delay(3000); | |
myservo.write(180); // 180 will move a cont. Servo to the right | |
delay(1900); | |
myservo.write(90); | |
delay(3000); | |
} |
No comments:
Post a Comment