/********************************************************************************** * Program Name:test_C01_F1_B1_F2.5_CW * Author :inoue * Date : 2006-08-25 05:44:29 * explanation : * * JAPANROBOTECH C-Language Development Environment **********************************************************************************/ #include "JRT102.h" // Hardware definition #include "RoboDesigner.h"// RoboDesigner Hardware definition #include "TiCollaLib.h" // Library definition #include "vectors.h" // Interruption vector definition #include "initialize.h" // Ininitalize #include "interrupt.h" // Interruption /*--------------------------------------------------------------------------------*/ /* Variable declaration */ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /* Prototype declaration */ /*--------------------------------------------------------------------------------*/ void Forward( void ); /*--------------------------------------------------------------------------------*/ /* main */ /*--------------------------------------------------------------------------------*/ void main(void) { init(); //Initialization MOTOR_SPD(PWM_SIDE_CN11, MOTOR_STEP_MID1); // スピード設定 M1_IN1 = 1; //前進 1秒 M1_IN2 = 0; M2_IN1 = 1; M2_IN2 = 0; DELAY_SEC(100); M1_IN1 = 0; //後退 1秒 M1_IN2 = 1; M2_IN1 = 0; M2_IN2 = 1; DELAY_SEC(100); Forward(); while(1){ M1_IN1 = 1; //CW方向に回転しつづける M1_IN2 = 0; M2_IN1 = 0; M2_IN2 = 0; COPCTL = 0; } } /*--------------------------------------------------------------------------------*/ /* function */ /*--------------------------------------------------------------------------------*/ void Forward( void ){ //前進 2.5秒 M1_IN1 = 1; M1_IN2 = 0; M2_IN1 = 1; M2_IN2 = 0; DELAY_SEC(250); }