Skip to content

Instantly share code, notes, and snippets.

@foradian
Created May 11, 2011 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foradian/966324 to your computer and use it in GitHub Desktop.
Save foradian/966324 to your computer and use it in GitHub Desktop.
Hack2 Locate Obstacle
int min_index=0;
for(i=0;i<3;i++)
if(area_sums[i] < area_sums[min_index])
min_index = i;
int j;
printf("Minimum at %d\n",min_index);
if(pin_is_set(LP_PIN[min_index+2])){
//do nothing
}
else{
for(j=0;j<5;j++)
clear_pin(LP_PIN[j]);
set_pin(LP_PIN[min_index+2]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment