Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / robot / robot_slave / robot_slave.c @ 680

History | View | Annotate | Download (643 Bytes)

1 13 emarinel
/**
2
 * Eugene Marinelli
3
 * 4/5/07
4
 *
5
 * Robot slave program -- just listens for packets
6
 */
7
8 156 emarinel
#include <dragonfly_lib.h>
9
#include <colonet_dragonfly.h>
10
#include <wireless.h>
11 423 emarinel
#include <wl_token_ring.h>
12 156 emarinel
#include <serial.h>
13 13 emarinel
#include <stdio.h>
14
15 644 gtress
int behavior_status;
16
17 680 emarinel
static void step() {}
18
19 156 emarinel
int main(void) {
20 174 emarinel
  dragonfly_init(ALL_ON);
21
22
  orb_set_color(RED);
23
  usb_puts("calling wl_init\n");
24
25 13 emarinel
  wl_init();
26 156 emarinel
  colonet_init();
27 13 emarinel
28 423 emarinel
  wl_token_ring_register();
29 13 emarinel
30 423 emarinel
  if (wl_token_ring_join() == 0) {
31
    orb_set_color(GREEN);
32
33 680 emarinel
    colonet_run(step);
34 423 emarinel
  } else {
35
    orb_set_color(RED);
36 174 emarinel
  }
37 423 emarinel
38 680 emarinel
  usb_puts("Failed to join token ring.\n");
39
40 423 emarinel
  while(1);
41
42 13 emarinel
  return 0;
43
}