From 1f53c255772e350bab310c53bf47af5f245f1ab5 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 10 Dec 2011 16:23:06 +0900 Subject: [PATCH] RangeFinder - small bug fix to initialise prescale variable. Fixed up example sketch so it compiles and works again! --- libraries/AP_AnalogSource/AP_AnalogSource_ADC.h | 2 +- libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarXL.h | 2 -- libraries/AP_RangeFinder/RangeFinder.h | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/AP_AnalogSource/AP_AnalogSource_ADC.h b/libraries/AP_AnalogSource/AP_AnalogSource_ADC.h index a438f00f40..c6807eaba1 100644 --- a/libraries/AP_AnalogSource/AP_AnalogSource_ADC.h +++ b/libraries/AP_AnalogSource/AP_AnalogSource_ADC.h @@ -9,7 +9,7 @@ class AP_AnalogSource_ADC : public AP_AnalogSource { public: AP_AnalogSource_ADC( AP_ADC * adc, int ch, float prescale = 1.0 ) : - _adc(adc), _ch(ch) {} + _adc(adc), _ch(ch), _prescale(prescale) {} int read(void); private: diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarXL.h b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarXL.h index 6dea8c63a9..6492bb2599 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarXL.h +++ b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarXL.h @@ -8,8 +8,6 @@ class AP_RangeFinder_MaxsonarXL : public RangeFinder { - // public: - //AP_GPS_MTK(Stream *s); public: AP_RangeFinder_MaxsonarXL(AP_AnalogSource *source, ModeFilter *filter); diff --git a/libraries/AP_RangeFinder/RangeFinder.h b/libraries/AP_RangeFinder/RangeFinder.h index 8e930b0d05..5b08ce4723 100644 --- a/libraries/AP_RangeFinder/RangeFinder.h +++ b/libraries/AP_RangeFinder/RangeFinder.h @@ -18,9 +18,9 @@ #define AP_RANGEFINDER_ORIENTATION_BACK_LEFT 5, -5, 0 #define AP_RANGEFINDER_ORIENTATION_FRONT_LEFT 5, 5, 0 */ -//#define AP_RANGEFINDER_PITOT_TUBE 1007 -//#define AP_RANGEFINDER_NUM_AVERAGES 4 +// define Pitot tube's ADC Channel +#define AP_RANGEFINDER_PITOT_TYPE_ADC_CHANNEL 7 class RangeFinder {