Project

General

Profile

Revision 328

Added by James Kong over 16 years ago

Kevin you suck. -- Chris Your code does not compile. --Brian and Chris I changed analog8 to be what you had as analog_get8, and I did change the methods used in rangefinders and BOM.

View differences:

bom.c
108 108
 *
109 109
 * @see analog_init
110 110
 **/
111
int get_max_bom(void)
112
{
111
int get_max_bom(void) {
113 112
	int max_bom_temp = 0;
114
	int a, i, j, h = 255;
113
	int a, i, j, h;
114
    h = 255;
115 115

  
116 116
	//Turn off the loop so that we can actually use analog8 correctly
117 117
	analog_stop_loop();
118 118

  
119 119
	//Iterate through through each LED
120
	for (j = 0; j < 16; j++)
121
	{
122
		i = lookup[j];
123
	
124
		if (i&8)
125
			output_high(MONK3);
126
		else
127
			output_low(MONK3);
128
	
129
		if (i&4)
130
			output_high(MONK2);
131
		else
132
			output_low(MONK2);
133
	
134
		if (i&2)
135
			output_high(MONK1);
136
		else
137
			output_low(MONK1);
138
	
139
		if (i&1)
140
			output_high(MONK0);
141
		else
142
			output_low(MONK0);
143
		
144
		a = analog_get8(MONKI);
145
	          
146
		if (a < h)
147
		{
148
			h = a;
149
			max_bom_temp = j;
150
		}
120
    for (j = 0; j < 16; j++)
121
    {
122
      i = lookup[j];
151 123

  
152
	}
124
      if (i&8)
125
        output_high(MONK3);
126
      else
127
        output_low(MONK3);
128

  
129
      if (i&4)
130
        output_high(MONK2);
131
      else
132
        output_low(MONK2);
133

  
134
      if (i&2)
135
        output_high(MONK1);
136
      else
137
        output_low(MONK1);
138

  
139
      if (i&1)
140
        output_high(MONK0);
141
      else
142
        output_low(MONK0);
143

  
144
      a = analog8(MONKI);
145
              
146
      if (a < h)
147
      {
148
        h = a;
149
        max_bom_temp = j;
150
      }
151

  
152
    }
153 153
	
154 154
	//Restart loop now that we are done using analog8
155 155
	analog_start_loop();

Also available in: Unified diff