Project

General

Profile

Revision 1469

Tried to get it to work to no avail. Various small changes.

View differences:

smart_run_around_fsm.c
3 3

  
4 4
void run_around_init(void)
5 5
{
6
  range_init();
7
  orb_init();
6
  //range_init();
7
  //orb_init();
8 8
 
9 9
  state = SRA_FORWARD;  // start out moving forward
10 10
  // initialize rangefinder values to 0
......
86 86
    switch (state)
87 87
    {
88 88
	case SRA_FORWARD:
89
	    orb_set_color(GREEN);
89
	    //orb_set_color(GREEN);
90 90
	    move(220, 0);	// drive straight forward
91 91
	    break;
92 92
	case SRA_LEFT:
93
	    orbs_set_color(GREEN, YELLOW);  // green on left side
93
	    //orbs_set_color(GREEN, YELLOW);  // green on left side
94 94
	    move(HALF_SPD, NRML_TURN);	// drive forward and to the left
95 95
	    break;
96 96
	case SRA_RIGHT:
97
	    orbs_set_color(YELLOW, GREEN);  // green on right side
97
	    //orbs_set_color(YELLOW, GREEN);  // green on right side
98 98
	    move(HALF_SPD, -NRML_TURN);	// drive forward and to the right
99 99
	    break;
100 100
	case SRA_SPIN:
101
	    orb_set_color(RED);
101
	    //orb_set_color(RED);
102 102
	    move(0, NRML_TURN);	// spin CCW without traveling
103 103
	    break;
104 104
	default:    // should never reach this
105
	    orb_set_color(PURPLE);
105
	    //orb_set_color(PURPLE);
106 106
	    move(0, 0);	// stop completely
107 107
    }
108 108
}

Also available in: Unified diff