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
Revision 11:234c5cd2b8de, committed 2015-12-19
- Comitter:
- mjr
- Date:
- Sat Dec 19 06:36:25 2015 +0000
- Parent:
- 10:afc3b84dbbd6
- Commit message:
- Minor changes
Changed in this revision
FastAnalogIn_KLXX_K20D50M.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r afc3b84dbbd6 -r 234c5cd2b8de FastAnalogIn_KLXX_K20D50M.cpp --- 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");