summaryrefslogtreecommitdiff
path: root/user-code/servo/arduino/servo-init/servo-init.ino
blob: 77d2aa7e8e8e9603529c7bbfe38ad7e2cee5923b (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 
void setup() {
  Serial.begin(115200); 
  myservo.attach(5); // attach the servo object on to pin 5 
  myservo.write(30); // tell servo to rotate by 30 degrees
  delay(1000);
  myservo.detach();
}  
void loop() {
}