Rev 1213 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
#include "kernel/kern.h"
#include "drivers/keyb.h"
#include "servo.h"
#include "leg.h"
int main () {
int res;
char ch;
/*
servo_open(SERVO_COM2);
cprintf("servo_set_RS232_baudrate\n");
res = servo_set_RS232_baudrate(9600);
cprintf("Res = %d\n",res);
cprintf("servo_get_RS232_baudrate\n");
res = servo_get_RS232_baudrate();
cprintf("Res = %d\n",res);
cprintf("servo_store_RS232_baudrate\n");
res = servo_store_RS232_baudrate();
cprintf("Res = %d\n",res);
cprintf("servo_set_period\n");
res = servo_set_period(20000);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_get_period\n");
res = servo_get_period();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_store_period\n");
res = servo_store_period();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_get_setup_switch\n");
res = servo_get_setup_switch();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_set_RC5_switch\n");
res = servo_set_RC5_switch(1);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_turn_off\n");
res = servo_turn_off(1);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_turn_on\n");
res = servo_turn_on(1);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_turn_off_all\n");
res = servo_turn_off_all();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_turn_on_all\n");
res = servo_turn_on_all();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_set_levels\n");
res = servo_set_levels(0x00,0x01);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_get_levels\n");
res = servo_get_levels();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_store_levels\n");
res = servo_store_levels();
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_set_angle_sec\n");
res = servo_set_angle_sec(0,ANGLE2SEC(45,0,0));
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_store_default_position\n");
res = servo_store_default_position(0);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_get_angle_sec\n");
res = servo_get_angle_sec(0);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
cprintf("servo_get_analog\n");
res = servo_get_analog(0);
cprintf("Res = %d\n",res);
ch = keyb_getch(BLOCK);
servo_close();
*/
set_leg_position(8.0,-5.0,0.0);
set_leg_position(8.0,0.0,0.0);
return 0;
}