esha492

DC with fan

Oct 7th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const int PinMotor =3;
  2.  
  3. void setup () {
  4. pinMode(PinMotor, OUTPUT);
  5. Serial.begin (9600);
  6.  
  7. }
  8.  
  9. void loop() {
  10.  
  11. for (int i=50; i <=255; i++)
  12. {
  13. analogWrite (PinMotor, i);
  14. delay(25);
  15. }
  16. delay (200);
  17.  
  18. for (int i=50; i >=0; i--)
  19. {
  20. analogWrite (PinMotor, i);
  21. delay(25);
  22. }
  23. delay (200);
  24. }
Add Comment
Please, Sign In to add comment