Advertisement
rosea4

Code 4-1 in black book

Apr 8th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. const int motor=9 ;
  2. void setup()
  3. {
  4. pinMode (motor, OUTPUT);
  5. }
  6. void loop()
  7. {
  8. for (int i=0; i<256; i++)
  9. {
  10. analogWrite(motor, i);
  11. delay(10) ;
  12. }
  13. delay (2000) ;
  14. for (int i=255; i>=0; i--)
  15. {
  16. analogWrite(motor, i);
  17. delay(10) ;
  18. }
  19. delay(2000);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement