Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1284 giacomo 1
#include "kernel/kern.h"
1464 giacomo 2
#include "drivers/shark_keyb26.h"
1284 giacomo 3
 
4
#include "servo.h"
5
 
6
#define N_SEND 100000
7
 
8
int main () {
9
 
10
  TIME seme;
11
  int res, i, err=0;
12
  int rnd1, rnd2;
13
 
14
  seme = sys_gettime(NULL);
15
  srand(seme);
16
 
1478 giacomo 17
  cprintf("(Open Com2)");
1477 giacomo 18
  res = servo_open(COM2, 115200);
1478 giacomo 19
  cprintf("(Res = %d)",res);
1284 giacomo 20
 
1478 giacomo 21
  cprintf("(Servo Turn On 0)");
1477 giacomo 22
  res = servo_turn_on(COM2, 0);
1478 giacomo 23
  cprintf("(Res = %d)",res);
1284 giacomo 24
 
1477 giacomo 25
  sleep(5);
1284 giacomo 26
 
1478 giacomo 27
  cprintf("(Servo set angle 45)");
1477 giacomo 28
  res = servo_set_angle_sec(COM2, 0, ANGLE2SEC(45,0,0));
1478 giacomo 29
  cprintf("(Res = %d)",res);
1284 giacomo 30
 
1477 giacomo 31
  sleep(5);
1284 giacomo 32
 
1477 giacomo 33
  servo_close(COM2);
1284 giacomo 34
 
1477 giacomo 35
  sys_end();
1284 giacomo 36
 
37
  return 0;
38
 
39
}
40