AP_ADC_AnalogSource: obey changes to AnalogSource interface

This commit is contained in:
Pat Hickey 2012-12-04 14:56:57 -08:00 committed by Andrew Tridgell
parent 2be552ea22
commit a6d80af9ed
2 changed files with 7 additions and 1 deletions

View File

@ -1,8 +1,13 @@
#include "AP_AnalogSource_ADC.h"
#include "AP_ADC_AnalogSource.h"
float AP_ADC_AnalogSource::read() {
float fullscale = _adc->Ch(_ch);
float scaled = _prescale * fullscale;
return scaled;
}
void AP_ADC_AnalogSource::set_pin(uint8_t machtnichts) {
/* it would be an error to call this
* but for now we'll leave it a no-op. */
}

View File

@ -12,6 +12,7 @@ public:
_adc(adc), _ch(ch), _prescale(prescale)
{}
float read(void);
void set_pin(uint8_t);
private:
AP_ADC * _adc;