Tzouraguy

RoboLab 4_2 full code

Nov 20th, 2020 (edited)
871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2.  
  3. Servo my_servo;
  4. int angle;
  5.  
  6.  
  7. void setup()
  8. {
  9.   my_servo.attach(6);//Assign pin to component
  10.   angle=0;
  11. }
  12.  
  13. void loop()
  14. {
  15.   my_servo.write(angle);
  16.   angle++;
  17.   if(angle>180)
  18.     angle=0;
  19.   delay(200);
  20. }
Add Comment
Please, Sign In to add comment