ardupilot/libraries/AP_AnalogSource/AP_AnalogSource_ADC.cpp
Andrew Tridgell 7c939e83e0 AnalogSource: return a float from read() method
this gives the full resolution when using the ADC backend. It also
adds scaling for the Arduino backend
2011-12-17 07:29:09 +11:00

10 lines
175 B
C++

#include "AP_AnalogSource_ADC.h"
float AP_AnalogSource_ADC::read(void)
{
float fullscale = _adc->Ch(_ch);
float scaled = _prescale * fullscale;
return scaled;
}