SHARE
TWEET

wall-e controller arduino

a guest Jul 23rd, 2014 3,704 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2.  
  3. Servo myservo;  // create servo object to control a servo
  4.  
  5. void setup()
  6. {
  7.   myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  8.   Serial.begin(9600);
  9. }
  10.  
  11.  
  12. void loop()
  13. {
  14.   if(Serial.available()>0){
  15.     byte angel=Serial.read();
  16.     Serial.println(angel);
  17.     myservo.write(angel);
  18.   }
  19.   delay(1);
  20. }
RAW Paste Data
Top