/*****************************/
/* Square Program */
/* */
/* programed by Yuki Akahori */
/* Ver 1.0 2002 11 13 */
/*****************************/
#include <dmotor.h>
#include <unistd.h> // sleep() is included
#define MOVE_TIME 1000 // Time for a straight move
#define TURN_TIME 1450 // Time for turning 90 degrees
int main(int argc, char *argv[]) {
int count;
motor_a_speed(MAX_SPEED);
motor_c_speed(MAX_SPEED);
for(count=0;count<4;count++){ // repeats 4 times
motor_a_dir(fwd);
motor_c_dir(fwd);
msleep(MOVE_TIME);
motor_c_dir(rev);
msleep(TURN_TIME);
motor_a_dir(brake);
motor_c_dir(brake);
}
return 0;
}
|