IntroRoboticsLab2/motion.ino

30 lines
490 B
C++

#include "MeMCore.h"
MeDCMotor motor1(9);
MeDCMotor motor2(10);
uint8_t motorSpeed = 100;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
motor1.run(-motorSpeed);
motor2.run(motorSpeed);
delay (1000);
motor1.stop();
motor2.stop();
delay (1000);
motor1.run(-motorSpeed);
motor2.run(-motorSpeed);
delay(1000);
motor1.stop();
motor2.stop();
delay (1000);
}