2011-11-12 23:14:55 -04:00
|
|
|
|
|
|
|
#ifndef __AP_ANALOG_SOURCE_ADC_H__
|
|
|
|
#define __AP_ANALOG_SOURCE_ADC_H__
|
|
|
|
|
|
|
|
#include "AnalogSource.h"
|
|
|
|
#include "../AP_ADC/AP_ADC.h"
|
|
|
|
|
|
|
|
class AP_AnalogSource_ADC : public AP_AnalogSource
|
|
|
|
{
|
2012-08-17 03:08:47 -03:00
|
|
|
public:
|
2012-06-29 08:48:34 -03:00
|
|
|
AP_AnalogSource_ADC( AP_ADC * adc, uint8_t ch, float prescale = 1.0 ) :
|
2012-08-17 03:08:47 -03:00
|
|
|
_adc(adc), _ch(ch), _prescale(prescale) {
|
|
|
|
}
|
|
|
|
float read(void);
|
2011-11-12 23:14:55 -04:00
|
|
|
|
2012-08-17 03:08:47 -03:00
|
|
|
private:
|
|
|
|
AP_ADC * _adc;
|
|
|
|
uint8_t _ch;
|
|
|
|
float _prescale;
|
2011-11-12 23:14:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_ANALOG_SOURCE_ADC_H__
|