Advertisement
katiebogdanow

Untitled

Jan 16th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int motorPin =3;
  2.  
  3. void setup() {
  4. pinMode(motorPin, OUTPUT);
  5. Serial.begin(9600);
  6. while (! Serial);
  7. Serial.println("Speed 0 to 255");
  8.  
  9. }
  10.  
  11. void loop() {
  12. // if (Serial.available())
  13. // {
  14. // int speed = Serial.parseInt();
  15. // if (speed >=0 && speed <=255)
  16. // {
  17. analogWrite(motorPin, 255);
  18. delay (1000);
  19. analogWrite(motorPin, 50);
  20. delay(1000);
  21. //
  22. // }
  23. // }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement