root / trunk / code / projects / calibration_platform / robot / cal_sta_robot.c @ 1930
History | View | Annotate | Download (971 Bytes)
1 | 1930 | jsexton | /*
|
---|---|---|---|
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 | 1926 | jsexton | |
12 | #include <dragonfly_lib.h> |
||
13 | #include <wl_basic.h> |
||
14 | |||
15 | 1930 | jsexton | /* Time delay which determines how long the robot circles before it
|
16 | * changes direction. */
|
||
17 | #define TIME_DELAY 1000 |
||
18 | 1926 | jsexton | |
19 | 1930 | jsexton | int main (void) { |
20 | 1926 | jsexton | |
21 | 1930 | jsexton | /* Initialize the dragonfly boards, the xbee, and the encoders */
|
22 | dragonfly_init(ALL_ON); |
||
23 | xbee_init(); |
||
24 | encoders_init(); |
||
25 | 1926 | jsexton | |
26 | 1930 | jsexton | while (1) { |
27 | /* Drive left, set orbs, and wait */
|
||
28 | orbs_set_color(RED, GREEN); |
||
29 | usb_puts("Robot\n");
|
||
30 | delay_ms(TIME_DELAY); |
||
31 | 1926 | jsexton | |
32 | 1930 | jsexton | /* Drive right, change orb colors, and wait */
|
33 | orbs_set_color(PURPLE, BLUE); |
||
34 | usb_puts("Marvin\n");
|
||
35 | delay_ms(TIME_DELAY); |
||
36 | 1926 | jsexton | } |
37 | |||
38 | } |