#include #include #include #include int main() { int i; khep_cmd_ret_t ret; khep_hand_t hand = khep_open("/dev/rfcomm0", KHEP_B38400); khep_cmd_raw(hand, "D,10,10"); khep_cmd_setled(hand, LED_FRONTAL, LED_ON); ret = khep_cmd_setspeed(hand, 10, 10); printf("ret = %d\n", ret.result); sleep(2); khep_cmd_setled(hand, LED_LATERAL, LED_ON); ret = khep_cmd_setspeed(hand, -10, -10); printf("ret = %d\n", ret.result); sleep(2); khep_cmd_setled(hand, LED_LATERAL, LED_TOGGLE); khep_cmd_setled(hand, LED_FRONTAL, LED_OFF); ret = khep_cmd_setspeed(hand, 0, 0); printf("ret = %d\n", ret.result); /* khep_cmd_raw(hand, "D,20,20"); */ /* sleep(2); */ /* khep_cmd_raw(hand, "D,0,0"); */ /* for(i=0;i<100;i++) */ /* { */ /* if ( i % 2 ) */ /* khep_cmd_raw(hand, "L,1,2"); */ /* else */ /* khep_cmd_raw(hand, "L,0,2"); */ /* } */ khep_close(hand); return 0; }