motion
This commit is contained in:
parent
69b25235f7
commit
ed1830fdd0
|
|
@ -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);
|
||||
}
|
||||
Loading…
Reference in New Issue