mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 05:58:30 -04:00
ArduCopter - removed limitation on Maxbotix sonar type requiring ADC so it can work with APM2.
modified default analog pin in test sketch to be AN4 which is consistent with APM2 default
This commit is contained in:
parent
df1e54ec79
commit
fa0723f115
@ -136,10 +136,6 @@
|
||||
// Sonar
|
||||
//
|
||||
|
||||
#ifndef SONAR_PORT
|
||||
# define SONAR_PORT AP_RANGEFINDER_PITOT_TUBE
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SONAR_SOURCE
|
||||
# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ADC
|
||||
#endif
|
||||
@ -169,18 +165,6 @@
|
||||
# define SONAR_TYPE MAX_SONAR_XL
|
||||
#endif
|
||||
|
||||
// It seems that MAX_SONAR_XL depends on an ADC. For systems without an
|
||||
// ADC, we need to disable the sonar
|
||||
#if SONAR_TYPE == MAX_SONAR_XL
|
||||
# if CONFIG_ADC == DISABLED
|
||||
# if defined(CONFIG_SONAR)
|
||||
# warning "MAX_SONAR_XL requires a valid ADC. This system does not have an ADC enabled."
|
||||
# undef CONFIG_SONAR
|
||||
# endif
|
||||
# define CONFIG_SONAR DISABLED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SONAR
|
||||
# define CONFIG_SONAR ENABLED
|
||||
#endif
|
||||
|
@ -19,7 +19,7 @@ ModeFilter mode_filter;
|
||||
|
||||
// uncomment the appropriate line corresponding to where sonar is connected
|
||||
AP_AnalogSource_ADC adc_source(&adc, AP_RANGEFINDER_PITOT_TYPE_ADC_CHANNEL, 0.25); // uncomment this line to use Pitot tube
|
||||
//AP_AnalogSource_Arduino adc_source(A5); // uncomment this line to use A5 analog pin (far back-right pin on the oilpan near the CLI switch
|
||||
//AP_AnalogSource_Arduino adc_source(A4); // uncomment this line to use A5 analog pin (far back-right pin on the oilpan near the CLI switch
|
||||
|
||||
// create the range finder object
|
||||
//AP_RangeFinder_SharpGP2Y aRF(&adc_source, &mode_filter);
|
||||
|
Loading…
Reference in New Issue
Block a user