You need to go through the array indeed, if data in the array is not ordered then start from index 0 and plan to go all the way to last index in the array and if you find your value use the break statement to exit the for loop.
Gorkde:
Thanks I assumed ther must be an existing function for thin in C
If you put the value that indicates calibration has not occurred in a particular place in the array you wouldn't need to search through looking for it. Perhaps that could be the first, or even the last, value in the array. Is that possible?
so basically to use, You need to tell it 3 parameter, One is the array you are using... The size of the array, and lastly, the value that you are seeking...
in my case i am more interested in the location of the value i serch.. but for you maybe you are waiting for the -1 value that the fucnction return. Basically if return value is not -1, it mean your system have not been calibrated.
that function will actually return as soon as it finds the element and give you the index.
There is a challenge with it though. it is supposed to return an unsigned int on 8 bits (uint8_t). so not only you are limited to arrays with 256 values but -1 is not really actually something that function should return.