Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Jung Min Yean
- * Learning How to Use a Continuous Motor
- * 04/23/2019
- */
- const int motorPin = 9;
- void setup()
- {
- pinMode(motorPin, OUTPUT);
- Serial.begin(9600);
- }
- void loop()
- {
- for (int i = 0; i<255; i++)
- {
- analogWrite(motorPin,i);
- delay(10);
- }
- delay(100);
- for (int i = 255; i>0; i--)
- {
- analogWrite(motorPin,i);
- delay(10);
- }
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement