Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. const int motorPin = 9;
  2. void setup() {
  3. // put your setup code here, to run once:
  4. pinMode(motorPin, OUTPUT);
  5. Serial.begin(9600);
  6. }
  7.  
  8. void loop() {
  9.  
  10. for(int i = 0; i<255; i++){
  11. analogWrite(motorPin,i);
  12. delay(10);
  13. }
  14. delay(100);
  15.  
  16. for(int i = 255; i>0; i--){
  17. analogWrite(motorPin,i);
  18. delay(10);
  19. }
  20. delay(100);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement