From cfae8490d5bb702bf7e8d7910710de060904734c Mon Sep 17 00:00:00 2001 From: "james.goppert" Date: Sat, 27 Nov 2010 04:56:31 +0000 Subject: [PATCH] Switch ArducopterNG to use AP_ADC library. git-svn-id: https://arducopter.googlecode.com/svn/trunk@950 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArducopterNG/ArducopterNG.pde | 8 ++++---- ArducopterNG/CLI.pde | 8 ++++---- ArducopterNG/Heli.h | 2 +- ArducopterNG/Sensors.pde | 2 +- ArducopterNG/System.pde | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ArducopterNG/ArducopterNG.pde b/ArducopterNG/ArducopterNG.pde index f30c6cf694..2e54fcb36d 100644 --- a/ArducopterNG/ArducopterNG.pde +++ b/ArducopterNG/ArducopterNG.pde @@ -28,7 +28,7 @@ /* Mounting position : RC connectors pointing backwards */ /* This code use this libraries : */ /* APM_RC : Radio library (with InstantPWM) */ -/* APM_ADC : External ADC library */ +/* AP_ADC : External ADC library */ /* DataFlash : DataFlash log library */ /* APM_BMP085 : BMP085 barometer library */ /* APM_Compass : HMC5843 compass library [optional] */ @@ -164,7 +164,7 @@ #include #include #include // ArduPilot Mega RC Library -#include // ArduPilot Mega Analog to Digital Converter Library +#include // ArduPilot Mega Analog to Digital Converter Library #include // ArduPilot Mega BMP085 Library #include // ArduPilot Mega Flash Memory Library #include // ArduPilot Mega Magnetometer Library @@ -190,7 +190,7 @@ #define VER 1.52 // Current software version (only numeric values) // Sensors - declare one global instance -APM_ADC_Class APM_ADC; +AP_ADC_ADS7844 adc; APM_BMP085_Class APM_BMP085; APM_Compass_Class APM_Compass; @@ -231,7 +231,7 @@ void setup() { /* ************** MAIN PROGRAM - MAIN LOOP ******************** */ /* ************************************************************ */ -// Sensor reading loop is inside APM_ADC and runs at 400Hz (based on Timer2 interrupt) +// Sensor reading loop is inside AP_ADC and runs at 400Hz (based on Timer2 interrupt) // * fast rate loop => Main loop => 200Hz // read sensors diff --git a/ArducopterNG/CLI.pde b/ArducopterNG/CLI.pde index b0408db0ef..a89a341941 100644 --- a/ArducopterNG/CLI.pde +++ b/ArducopterNG/CLI.pde @@ -175,7 +175,7 @@ void CALIB_AccOffset() { uint8_t loopy; uint16_t xx = 0, xy = 0, xz = 0; - APM_ADC.Init(); // APM ADC library initialization + adc.Init(); // APM ADC library initialization // delay(250); // Giving small moment before starting calibrateSensors(); // Calibrate neutral values of gyros (in Sensors.pde) @@ -195,11 +195,11 @@ void CALIB_AccOffset() { tab(); SerPrln(xz += read_adc(5)); */ - SerPri(xx += APM_ADC.Ch(4)); + SerPri(xx += adc.Ch(4)); tab(); - SerPri(xy += APM_ADC.Ch(5)); + SerPri(xy += adc.Ch(5)); tab(); - SerPrln(xz += APM_ADC.Ch(3)); + SerPrln(xz += adc.Ch(3)); diff --git a/ArducopterNG/Heli.h b/ArducopterNG/Heli.h index de69e4e9fa..8fdb53871f 100644 --- a/ArducopterNG/Heli.h +++ b/ArducopterNG/Heli.h @@ -40,7 +40,7 @@ TODO: #include "WProgram.h" #include #include // added by Randy -#include // ArduPilot Mega Analog to Digital Converter Library +#include // ArduPilot Mega Analog to Digital Converter Library #include // ArduPilot Mega RC Library #include // ArduPilot Mega Compass Library #include // ArduPilot Mega DataFlash Library. diff --git a/ArducopterNG/Sensors.pde b/ArducopterNG/Sensors.pde index 12b3d2239c..bdea00f971 100644 --- a/ArducopterNG/Sensors.pde +++ b/ArducopterNG/Sensors.pde @@ -32,7 +32,7 @@ void Read_adc_raw(void) //int temp; for (int i=0;i<6;i++) - AN[i] = APM_ADC.Ch(sensors[i]); + AN[i] = adc.Ch(sensors[i]); } // Returns an analog value with the offset diff --git a/ArducopterNG/System.pde b/ArducopterNG/System.pde index e8450056a4..f090b3177a 100644 --- a/ArducopterNG/System.pde +++ b/ArducopterNG/System.pde @@ -79,7 +79,7 @@ void APM_Init() { // Wiggle LEDs while ESCs are rebooting FullBlink(50,20); - APM_ADC.Init(); // APM ADC library initialization + adc.Init(); // APM ADC library initialization DataFlash.Init(); // DataFlash log initialization #ifdef IsGPS