Hey I wrote this function to convert an bool array to int: (Math Lob included):
bool b_array[5];
int convertToInt(start_index,stop_index){ int run=0; int result=0; for(int id=start_index;id<=stop_index;id++){ result+=b_array[id] * pow(2.0,run); run++; } return result; }
bool b_array[5];
int convertToInt(start_index,stop_index){
int run=0;
int result=0;
for(int id=start_index;id<=stop_index;id++){
result+=b_array[id] * pow(2.0,run);
run++;
}
return result;
}
but it doesnt this work?
Thanks and kind regards Nic