added motor control Left Right

This commit is contained in:
Benjamin VALLET 2022-04-01 08:49:24 +02:00
parent 5b3b38e99a
commit 881eabfeaf
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
#include "MeOrion.h"
MeDCMotor motorL(M1); //positive go backward
MeDCMotor motorR(M2); //positive go forward
uint8_t motorSpeed = 100;
void setup()
{
}
void loop()
{
motorL.run(motorSpeed); /* value: between -255 and 255. */
//motorR.run(motorSpeed); /* value: between -255 and 255. */
delay(2000);
motorL.stop();
motorR.stop();
delay(100);
motorL.run(-motorSpeed);
motorR.run(-motorSpeed);
delay(2000);
motorL.stop();
motorR.stop();
delay(2000);
}