![](/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
xDotBridge/src/nBitAnalogLadder.cpp@31:9c535a708ae9, 2017-01-23 (annotated)
- Committer:
- Matt Briggs
- Date:
- Mon Jan 23 09:02:45 2017 -0700
- Revision:
- 31:9c535a708ae9
- Child:
- 33:c7bb3fbc024a
Adding code for analog ladder
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Matt Briggs | 31:9c535a708ae9 | 1 | #include "nBitAnalogLadder.h" |
Matt Briggs | 31:9c535a708ae9 | 2 | |
Matt Briggs | 31:9c535a708ae9 | 3 | uint8_t convAnalogLadder (const float &analogV, const float *valueTable, uint8_t nVals) { |
Matt Briggs | 31:9c535a708ae9 | 4 | uint8_t i; |
Matt Briggs | 31:9c535a708ae9 | 5 | for (i = 0; i < nVals; i++) { |
Matt Briggs | 31:9c535a708ae9 | 6 | if ((valueTable[i][TABLE_MIN_IDX] <= analogV) && |
Matt Briggs | 31:9c535a708ae9 | 7 | (analogV <= valueTable[i][TABLE_MIN_IDX])) { |
Matt Briggs | 31:9c535a708ae9 | 8 | break; |
Matt Briggs | 31:9c535a708ae9 | 9 | } |
Matt Briggs | 31:9c535a708ae9 | 10 | } |
Matt Briggs | 31:9c535a708ae9 | 11 | |
Matt Briggs | 31:9c535a708ae9 | 12 | return i; |
Matt Briggs | 31:9c535a708ae9 | 13 | } |