From 5d6ef456620686012de26c26a2999962eda792a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Jul 2014 10:41:53 +1000 Subject: [PATCH] AP_RangeFinder: removed old MaxSonarXL example --- .../examples/MaxsonarXL_test/Makefile | 2 - .../MaxsonarXL_test/MaxsonarXL_test.pde | 76 ------------------- .../examples/MaxsonarXL_test/nocore.inoflag | 0 3 files changed, 78 deletions(-) delete mode 100644 libraries/AP_RangeFinder/examples/MaxsonarXL_test/Makefile delete mode 100644 libraries/AP_RangeFinder/examples/MaxsonarXL_test/MaxsonarXL_test.pde delete mode 100644 libraries/AP_RangeFinder/examples/MaxsonarXL_test/nocore.inoflag diff --git a/libraries/AP_RangeFinder/examples/MaxsonarXL_test/Makefile b/libraries/AP_RangeFinder/examples/MaxsonarXL_test/Makefile deleted file mode 100644 index 87e4482ca3..0000000000 --- a/libraries/AP_RangeFinder/examples/MaxsonarXL_test/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -BOARD = mega -include ../../../../mk/apm.mk diff --git a/libraries/AP_RangeFinder/examples/MaxsonarXL_test/MaxsonarXL_test.pde b/libraries/AP_RangeFinder/examples/MaxsonarXL_test/MaxsonarXL_test.pde deleted file mode 100644 index 76144949aa..0000000000 --- a/libraries/AP_RangeFinder/examples/MaxsonarXL_test/MaxsonarXL_test.pde +++ /dev/null @@ -1,76 +0,0 @@ -/* - * AP_RangeFinder_test - * Code by DIYDrones.com - */ - -// includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// uncomment appropriate line corresponding to your sonar -#define SONAR_TYPE AP_RANGEFINDER_MAXSONARXL // 0 - XL (default) -//#define SONAR_TYPE AP_RANGEFINDER_MAXSONARLV // 1 - LV (cheaper) -//#define SONAR_TYPE AP_RANGEFINDER_MAXSONARXLL // 2 - XLL (XL with 10m range) -//#define SONAR_TYPE AP_RANGEFINDER_MAXSONARHRLV // 3 - HRLV-MaxSonar-EZ0 (5m range) -//#define SONAR_TYPE AP_RANGEFINDER_MAXSONARI2CXL // 4 - XLI2C (XL with I2C interface and 7m range) - -// For APM1 we use built in ADC for sonar reads from an analog pin -#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 && SONAR_TYPE <= AP_RANGEFINDER_MAXSONARHRLV -# define USE_ADC_ADS7844 // use APM1's built in ADC and connect sonar to pitot tube -#endif - -// define Pitot tube's ADC Channel -#define AP_RANGEFINDER_PITOT_TYPE_ADC_CHANNEL 7 - -//////////////////////////////////////////////////////////////////////////////// -// hal.console-> ports -//////////////////////////////////////////////////////////////////////////////// - - -const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; - -// declare global instances -ModeFilterInt16_Size5 mode_filter(2); - -#ifdef USE_ADC_ADS7844 -AP_ADC_ADS7844 adc; -AP_ADC_AnalogSource adc_analog_source(&adc, - AP_RANGEFINDER_PITOT_TYPE_ADC_CHANNEL, 0.25);// use Pitot tube -#endif - -AP_RangeFinder_MaxsonarXL *rf; - -void setup() -{ - hal.console->println("Range Finder Test v1.1"); - hal.console->print("Sonar Type: "); - hal.console->println(SONAR_TYPE); - -#ifdef USE_ADC_ADS7844 - adc.Init(); // APM ADC initialization - AP_HAL::AnalogSource *analog_source = &adc_analog_source; - float scaling = 3.3; -#else - AP_HAL::AnalogSource *analog_source = hal.analogin->channel(3); - float scaling = 5; -#endif - rf = new AP_RangeFinder_MaxsonarXL(analog_source, &mode_filter); - rf->calculate_scaler(SONAR_TYPE, scaling); // setup scaling for sonar -} - -void loop() -{ - hal.console->printf("dist: %d\n",(int)rf->read()); - hal.scheduler->delay(100); -} - -AP_HAL_MAIN(); diff --git a/libraries/AP_RangeFinder/examples/MaxsonarXL_test/nocore.inoflag b/libraries/AP_RangeFinder/examples/MaxsonarXL_test/nocore.inoflag deleted file mode 100644 index e69de29bb2..0000000000