root / branches / rbom / code / projects / colonet / testing / dongle / robot_receiver / robot_receiver.c @ 1390
History | View | Annotate | Download (750 Bytes)
1 | 13 | emarinel | /*
|
---|---|---|---|
2 | Eugene Marinelli
|
||
3 | 7/22/06
|
||
4 | */
|
||
5 | |||
6 | /* Includes */
|
||
7 | #include <stdio.h> |
||
8 | #include <string.h> |
||
9 | |||
10 | #include <firefly+_lib.h> |
||
11 | #include "pindefs_ff.h" |
||
12 | |||
13 | #include <wireless.h> |
||
14 | |||
15 | void init_hardware(void); |
||
16 | |||
17 | /* Main */
|
||
18 | int main(void){ |
||
19 | char buf[80]; |
||
20 | char src, dest;
|
||
21 | |||
22 | init_hardware(); |
||
23 | wl_init(15,1); |
||
24 | |||
25 | orb_set_color(BLUE); |
||
26 | |||
27 | while(1){ |
||
28 | if(wl_recv(buf, &src, &dest)){
|
||
29 | printf("%s", buf);
|
||
30 | orb_set_color(RED); |
||
31 | }else{
|
||
32 | printf(".");
|
||
33 | orb_set_color(BLUE); |
||
34 | } |
||
35 | |||
36 | wl_send("ABC", 200); |
||
37 | |||
38 | delay_ms(500);
|
||
39 | } |
||
40 | |||
41 | return 0; |
||
42 | } |
||
43 | |||
44 | void init_hardware(){
|
||
45 | motors_init(); |
||
46 | orb_init(); |
||
47 | led_init(); |
||
48 | analog_init(); |
||
49 | |||
50 | serial_init(BAUD9600); |
||
51 | serial1_init(BAUD115200); |
||
52 | lcd_init(); |
||
53 | |||
54 | fdevopen(&serial1_putchar, &serial1_getchar); |
||
55 | } |