Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Code for serial servo attachment
- #include <Servo.h>
- Servo servo1;
- long num1;
- void setup(){
- servo1.attach(3);
- Serial.begin(9600);
- servo1.write(90);
- }
- void loop() {
- while(Serial.available()>0)
- {
- num1= Serial.parseInt();
- Serial.print(num1);
- Serial.print(" degree , ");
- Serial.print("Enter Position = ");
- }
- servo1.write(num1);
- delay(15);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement