New motion lib
This commit is contained in:
@@ -1,27 +1,16 @@
|
||||
//#include <TimerOne.h>
|
||||
|
||||
#include <Motor.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
MotorA.torque(500);
|
||||
|
||||
MotorA.init();
|
||||
MotorA.torque(255);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
static int j = 1;
|
||||
static long cnt = 0;
|
||||
|
||||
if(cnt == 50000) {
|
||||
j = -1;
|
||||
MotorA.direction(FORWARD);
|
||||
} else if(cnt == 0) {
|
||||
j = 1;
|
||||
delay(1000);
|
||||
MotorA.direction(BACKWARD);
|
||||
}
|
||||
cnt += j;
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user