mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
ArduCopterNG - small cosmetic change & small change to how Wire.begin is called (now only called once). http://www.arduino.cc/en/Reference/WireBegin
git-svn-id: https://arducopter.googlecode.com/svn/trunk@885 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
3d80d7e580
commit
ef6519e406
@ -165,12 +165,9 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <APM_RC.h> // ArduPilot Mega RC Library
|
#include <APM_RC.h> // ArduPilot Mega RC Library
|
||||||
#include <APM_ADC.h> // ArduPilot Mega Analog to Digital Converter Library
|
#include <APM_ADC.h> // ArduPilot Mega Analog to Digital Converter Library
|
||||||
APM_ADC_Class APM_ADC; // Declare an instance
|
|
||||||
#include <APM_BMP085.h> // ArduPilot Mega BMP085 Library
|
#include <APM_BMP085.h> // ArduPilot Mega BMP085 Library
|
||||||
APM_BMP085_Class APM_BMP085;// Declare an instance
|
|
||||||
#include <DataFlash.h> // ArduPilot Mega Flash Memory Library
|
#include <DataFlash.h> // ArduPilot Mega Flash Memory Library
|
||||||
#include <APM_Compass.h> // ArduPilot Mega Magnetometer Library
|
#include <APM_Compass.h> // ArduPilot Mega Magnetometer Library
|
||||||
APM_Compass_Class APM_Compass; // Declare an instance
|
|
||||||
#include <Wire.h> // I2C Communication library
|
#include <Wire.h> // I2C Communication library
|
||||||
#include <EEPROM.h> // EEPROM
|
#include <EEPROM.h> // EEPROM
|
||||||
//#include <AP_GPS.h>
|
//#include <AP_GPS.h>
|
||||||
@ -189,6 +186,10 @@ APM_Compass_Class APM_Compass; // Declare an instance
|
|||||||
/* Software version */
|
/* Software version */
|
||||||
#define VER 1.52 // Current software version (only numeric values)
|
#define VER 1.52 // Current software version (only numeric values)
|
||||||
|
|
||||||
|
// Sensors - declare one global instance
|
||||||
|
APM_ADC_Class APM_ADC;
|
||||||
|
APM_BMP085_Class APM_BMP085;
|
||||||
|
APM_Compass_Class APM_Compass;
|
||||||
|
|
||||||
/* ************************************************************ */
|
/* ************************************************************ */
|
||||||
/* ************* MAIN PROGRAM - DECLARATIONS ****************** */
|
/* ************* MAIN PROGRAM - DECLARATIONS ****************** */
|
||||||
|
@ -125,9 +125,12 @@ void APM_Init() {
|
|||||||
APM_RC.OutputCh(2,MIN_THROTTLE);
|
APM_RC.OutputCh(2,MIN_THROTTLE);
|
||||||
APM_RC.OutputCh(3,MIN_THROTTLE);
|
APM_RC.OutputCh(3,MIN_THROTTLE);
|
||||||
|
|
||||||
|
// Initialise Wire library used by Magnetometer and Barometer
|
||||||
|
Wire.begin();
|
||||||
|
|
||||||
#ifdef IsMAG
|
#ifdef IsMAG
|
||||||
if (MAGNETOMETER == 1) {
|
if (MAGNETOMETER == 1) {
|
||||||
APM_Compass.Init(); // I2C initialization
|
APM_Compass.Init(FALSE); // I2C initialization
|
||||||
APM_Compass.SetOrientation(MAGORIENTATION);
|
APM_Compass.SetOrientation(MAGORIENTATION);
|
||||||
APM_Compass.SetOffsets(MAGOFFSET);
|
APM_Compass.SetOffsets(MAGOFFSET);
|
||||||
APM_Compass.SetDeclination(ToRad(DECLINATION));
|
APM_Compass.SetDeclination(ToRad(DECLINATION));
|
||||||
@ -169,7 +172,7 @@ void APM_Init() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UseBMP
|
#ifdef UseBMP
|
||||||
APM_BMP085.Init();
|
APM_BMP085.Init(FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user