Class similar to AnalogIn that uses burst mode to run continious background conversions so when the input is read, the last value can immediatly be returned. This slightly modified version allows NC pins.
Dependents: Pinscape_Controller
Fork of FastAnalogIn by
Diff: FastAnalogIn_KLXX_K20D50M.cpp
- Revision:
- 11:234c5cd2b8de
- Parent:
- 9:31184aa1449c
--- a/FastAnalogIn_KLXX_K20D50M.cpp Tue Nov 04 17:53:25 2014 +0000 +++ b/FastAnalogIn_KLXX_K20D50M.cpp Sat Dec 19 06:36:25 2015 +0000 @@ -24,6 +24,9 @@ FastAnalogIn::FastAnalogIn(PinName pin, bool enabled) { + if (pin == NC) + return; + ADCnumber = (ADCName)pinmap_peripheral(pin, PinMap_ADC); if (ADCnumber == (ADCName)NC) { error("ADC pin mapping failed");