Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int PWMPin = 10;
- int motorSpeed = 0
- void setup()
- {
- }
- void loop()
- {
- for (motorSpeed = 0 ; motorSpeed <= 255; motorSpeed += 10)
- {
- analogWrite(PWMPin, motorSpeed);
- delay(30);
- }
- for (motorSpeed = 255 ; motorSpeed >= 0; motorSpeed -= 10)
- {
- analogWrite(PWMPin, motorSpeed);
- delay(30);
- }
- }
Add Comment
Please, Sign In to add comment