direct_ctrl.c
00001
00002
00003
00004
00005
00006
00007 #include "directDeviceCtrl.h"
00008 #define C_RUNCTRL_SOURCE
00009 #include "commandCtrl.h"
00010
00011
00020 int setMotorPWM(int id, unsigned char duty) {
00021 unsigned char duty_array[1] = { duty };
00022 return sendMotorDuty(id, duty_array, 1);
00023 }
00024
00025
00036 int setMotorMode(int id, unsigned char mode) {
00037 unsigned char mode_array[1] = { mode };
00038 return sendMotorMode(id, mode_array, 1);
00039 }
00040
00041
00050 int getEncoderDiff(int id, int *cnt) {
00051 int cnt_array[1] = { 0 };
00052 return recvEncoderDiff(id, cnt_array, 1);
00053 }
00054
00055
00064 int setWheelVel(int id, int mm_vel) {
00065 int mm_vel_array[1] = { mm_vel };
00066 return sendWheelVel(id, mm_vel_array, 1);
00067 }
00068
00069