![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Diff: xDotBridge/src/nBitAnalogLadder.cpp
- Revision:
- 31:9c535a708ae9
- Child:
- 33:c7bb3fbc024a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xDotBridge/src/nBitAnalogLadder.cpp Mon Jan 23 09:02:45 2017 -0700 @@ -0,0 +1,13 @@ +#include "nBitAnalogLadder.h" + +uint8_t convAnalogLadder (const float &analogV, const float *valueTable, uint8_t nVals) { + uint8_t i; + for (i = 0; i < nVals; i++) { + if ((valueTable[i][TABLE_MIN_IDX] <= analogV) && + (analogV <= valueTable[i][TABLE_MIN_IDX])) { + break; + } + } + + return i; +}