Created
August 13, 2019 01:05
-
-
Save deviceplususer/143ab8eceb924fd2b070fd06969638a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int MT_F = 5; | |
const int MT_R = 6; | |
void setup(){ | |
pinMode( MT_F, OUTPUT ); | |
pinMode( MT_R, OUTPUT ); | |
} | |
void loop(){ | |
int speed; | |
analogWrite( MT_F, 0 ); | |
analogWrite( MT_R, 0 ); | |
speed = 0; | |
while( speed <= 255 ){ | |
analogWrite( MT_F, speed ); | |
delay( 100 ); | |
speed = speed + 5; | |
} | |
delay( 5000 ); | |
speed = 255; | |
while( speed >= 0 ){ | |
analogWrite( MT_F, speed ); | |
delay( 100 ); | |
speed = speed - 5; | |
} | |
delay( 5000 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment