root / trunk / code / behaviors / formation_control / push_pull / vectorTest.c @ 1536
History | View | Annotate | Download (620 Bytes)
1 |
#include <stdint.h> |
---|---|
2 |
#include <dragonfly_lib.h> |
3 |
#include <wl_basic.h> |
4 |
#include <stdlib.h> |
5 |
|
6 |
int main (void) { |
7 |
|
8 |
Vector v; |
9 |
int i;
|
10 |
int bomVals[16]; |
11 |
|
12 |
dragonfly_init(ALL_ON); |
13 |
xbee_init(); |
14 |
encoders_init(); |
15 |
|
16 |
orbs_set_color(BLUE, GREEN); |
17 |
delay_ms(1000);
|
18 |
orbs_set_color(GREEN, BLUE); |
19 |
delay_ms(1000);
|
20 |
orbs_set_color(RED, RED); |
21 |
|
22 |
while (1) { |
23 |
|
24 |
bom_refresh(BOM_ALL); |
25 |
for (i = 0; i < 16; i++) { |
26 |
bomVals[i] = bom_get(i); |
27 |
} |
28 |
|
29 |
bom_print_usb(bomVals); |
30 |
|
31 |
bom_get_norm_vector(&v, bomVals); |
32 |
|
33 |
usb_puts("x: ");
|
34 |
usb_puti(v.x); |
35 |
usb_puts("\ty: ");
|
36 |
usb_puti(v.y); |
37 |
usb_puts("\n");
|
38 |
|
39 |
delay_ms(50);
|
40 |
|
41 |
} |
42 |
|
43 |
while(1); |
44 |
|
45 |
} |