Subversion Repositories shark

Rev

Rev 1477 | Rev 1479 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "kernel/kern.h"
#include "drivers/shark_keyb26.h"

#include "servo.h"

#define N_SEND 100000

int main () {

  TIME seme;
  int res, i, err=0;
  int rnd1, rnd2;

  seme = sys_gettime(NULL);
  srand(seme);

  cprintf("(Open Com2)");
  res = servo_open(COM2, 115200);
  cprintf("(Res = %d)",res);

  cprintf("(Servo Turn On 0)");
  res = servo_turn_on(COM2, 0);
  cprintf("(Res = %d)",res);

  sleep(5);

  cprintf("(Servo set angle 45)");
  res = servo_set_angle_sec(COM2, 0, ANGLE2SEC(45,0,0));
  cprintf("(Res = %d)",res);

  sleep(5);

  servo_close(COM2);

  sys_end();

  return 0;

}