This commit is contained in:
Kilian DECLERCQ 2022-04-07 08:54:25 +02:00
parent 69b25235f7
commit ed1830fdd0
1 changed files with 29 additions and 0 deletions

29
motion/motion.ino Normal file
View File

@ -0,0 +1,29 @@
#include "MeMCore.h"
const int Port_1 =9;
const int Port_2 =10;
MeDCMotor motor1(Port_1);
MeDCMotor motor2(Port_2);
uint8_t motorSpeed =255;
void setup()
{
}
void loop()
{
motor1.run(motorSpeed); /* value: between -255 and 255. */
motor2.run(motorSpeed); /* value: between -255 and 255. */
delay(2000);
motor1.stop();
motor2.stop();
delay(100);
motor1.run(-motorSpeed);
motor2.run(-motorSpeed);
delay(2000);
motor1.stop();
motor2.stop();
delay(100);
}