mustang493:
yes but the mid value is not stable and can range a few points around 14435
So you need to change it to something like:
const int THRESHOLD = 5;
...
if ( (val > 14435 - THRESHOLD) && (val < 14435 + THRESHOLD) )
{
// At the midpoint
}
mustang493:
yes but the mid value is not stable and can range a few points around 14435
So you need to change it to something like:
const int THRESHOLD = 5;
...
if ( (val > 14435 - THRESHOLD) && (val < 14435 + THRESHOLD) )
{
// At the midpoint
}