Skip to content

Instantly share code, notes, and snippets.

@tairea
Last active September 21, 2021 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tairea/985ba2643e6976cc9a3b0b80500fda73 to your computer and use it in GitHub Desktop.
Save tairea/985ba2643e6976cc9a3b0b80500fda73 to your computer and use it in GitHub Desktop.
Arduino Robot Test
#include <AFMotor.h>
AF_DCMotor motorL(1);
AF_DCMotor motorR(2);
void setup() {
motorL.setSpeed(200);
motorR.setSpeed(200);
motorL.run(RELEASE);
motorR.run(RELEASE);
}
void loop() {
motorL.run(FORWARD);
motorR.run(FORWARD);
delay(2000);
motorL.run(RELEASE);
motorR.run(RELEASE);
delay(1000);
motorL.run(BACKWARD);
motorR.run(BACKWARD);
delay(2000);]
motorL.run(RELEASE);
motorR.run(RELEASE);
delay(1000);
motorL.run(FORWARD);
motorR.run(BACKWARD);
delay(500);
motorL.run(RELEASE);
motorR.run(RELEASE);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment