root / trunk / code / projects / calibration_platform / robot / cal_sta_robot.c @ 1932
History | View | Annotate | Download (977 Bytes)
1 |
/*
|
---|---|
2 |
* template.c - A starting point for developing behaviors using the Colony
|
3 |
* robots. To create a new behavior, you should copy this "template"
|
4 |
* folder to another folder and rename the "template.c" file
|
5 |
* appropriately.
|
6 |
*
|
7 |
* This template will have the robot drive in circles and flash the orbs.
|
8 |
*
|
9 |
* Author: John Sexton, Colony Project, CMU Robotics Club
|
10 |
*/
|
11 |
|
12 |
#include <dragonfly_lib.h> |
13 |
#include <wl_basic.h> |
14 |
|
15 |
/* Time delay which determines how long the robot circles before it
|
16 |
* changes direction. */
|
17 |
#define TIME_DELAY 1000 |
18 |
|
19 |
int main (void) { |
20 |
|
21 |
/* Initialize the dragonfly boards, the xbee, and the encoders */
|
22 |
dragonfly_init(ALL_ON); |
23 |
xbee_init(); |
24 |
encoders_init(); |
25 |
|
26 |
while (1) { |
27 |
/* Drive left, set orbs, and wait */
|
28 |
orbs_set_color(RED, GREEN); |
29 |
usb_puts("RO:Robot\n");
|
30 |
delay_ms(TIME_DELAY); |
31 |
|
32 |
/* Drive right, change orb colors, and wait */
|
33 |
orbs_set_color(PURPLE, BLUE); |
34 |
usb_puts("RO:Marvin\n");
|
35 |
delay_ms(TIME_DELAY); |
36 |
} |
37 |
|
38 |
} |