Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <AFMotor.h>
- // DC motor on M2
- AF_DCMotor motor1(3);
- AF_DCMotor motor2(4);
- void setup() {
- motor1.run(RELEASE);
- delay(60);
- motor2.run(RELEASE);
- delay(60);
- motor1.setSpeed(235);
- delay(60);
- motor2.setSpeed(235);
- }
- void loop() {
- delay(60);
- motor1.run(FORWARD);
- delay(60);
- motor2.run(FORWARD);
- delay(2000);
- motor1.run(RELEASE);
- delay(60);
- motor2.run(RELEASE);
- delay(3000);
- motor1.run(BACKWARD);
- delay(60);
- motor2.run(BACKWARD);
- delay(3000);
- motor1.run(RELEASE);
- delay(60);
- motor2.run(RELEASE);
- delay(3000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement