- // we do care about the actual theshold value as sometimes near the center of the
- // wave we may get static that changes direction of wave for one value
- // if our value is too low it might affect the read. and if our tag or
- // antenna is weak a setting too high might not see anything. [marshmellow]
- if (size<100) return 0;
- for(idx=1; idx<100; idx++){
- if(maxVal<dest[idx]) maxVal = dest[idx];
- }
- // set close to the top of the wave threshold with 25% margin for error
- // less likely to get a false transition up there.
- // (but have to be careful not to go too high and miss some short waves)
- uint8_t threshold_value = (uint8_t)(((maxVal-128)*.75)+128);