go forward

This commit is contained in:
Loic Delattre 2023-04-24 08:51:54 +02:00
parent 597b2ff15e
commit 8f0adb94c0
1 changed files with 19 additions and 2 deletions

View File

@ -1,9 +1,26 @@
#include <MeMCore.h>
MeDCMotor _rightMotor(10);
MeDCMotor _leftMotor(9);
void setup() {
// put your setup code here, to run once:
_leftMotor.run(0);
_rightMotor.run(0);
}
void loop() {
// put your main code here, to run repeatedly:
_leftMotor.run(50);
_rightMotor.run(50);
delay(3000);
_leftMotor.stop();
_rightMotor.stop();
}
void turn(int speed, int direction, int time){
//if direction = -1 turn right
_leftMotor.run(50);
_rightMotor.run(50);
}