Revision 1725 trunk/code/behaviors/formation_control/circle/circle.c
| circle.c (revision 1725) | ||
|---|---|---|
| 129 | 129 |
/* Sends a global packet with three arguments */ |
| 130 | 130 |
void send3(char arg0, char arg1, char arg2) |
| 131 | 131 |
{
|
| 132 |
char send_buffer[2]; |
|
| 132 |
char send_buffer[3]; |
|
| 133 | 133 |
send_buffer[0]=arg0; |
| 134 | 134 |
send_buffer[1]=arg1; |
| 135 | 135 |
send_buffer[2]=arg2; |
| ... | ... | |
| 202 | 202 |
orb_set_color(ORB_OFF); |
| 203 | 203 |
} |
| 204 | 204 |
|
| 205 |
/* |
|
| 206 |
BLINK slowly the given number times |
|
| 207 |
*/ |
|
| 208 |
void slowblink(int num) |
|
| 209 |
{
|
|
| 210 |
for(int i = 0; i<num; i++) |
|
| 211 |
{
|
|
| 212 |
orb_set_color(ORB_OFF); |
|
| 213 |
delay_ms(300); |
|
| 214 |
orb_set_color(RED); |
|
| 215 |
delay_ms(200); |
|
| 216 |
} |
|
| 217 |
orb_set_color(ORB_OFF); |
|
| 218 |
} |
|
| 205 | 219 |
|
| 206 | 220 |
|
| 207 | 221 |
|
| 208 | 222 |
|
| 209 | 223 |
|
| 210 | 224 |
|
| 225 |
|
|
| 211 | 226 |
//***************************************************************************************************************************************************************************************** |
| 212 | 227 |
|
| 213 | 228 |
|
| ... | ... | |
| 397 | 412 |
|
| 398 | 413 |
/* Blinks the direction it should turn. */ |
| 399 | 414 |
case 6: |
| 400 |
blink(direction); |
|
| 415 |
slowblink(direction); |
|
| 416 |
edge_State = 7; |
|
| 417 |
break; |
|
| 418 |
|
|
| 419 |
case 7: |
|
| 401 | 420 |
orb_set_color(GREEN); |
| 402 | 421 |
break; |
| 403 | 422 |
|
Also available in: Unified diff