barometer: print a message on barometer init in example code

this helps track down initialisation problems
This commit is contained in:
Andrew Tridgell 2011-09-11 09:39:35 +10:00
parent 4607bdb4b5
commit a5d2e96dc6
1 changed files with 7 additions and 5 deletions

View File

@ -12,9 +12,11 @@ unsigned long timer;
void setup()
{
APM_BMP085.Init(); // APM ADC initialization
Serial.begin(38400);
Serial.begin(115200);
Serial.println("ArduPilot Mega BMP085 library test");
Serial.println("Initialising barometer..."); delay(100);
APM_BMP085.Init(); // APM ADC initialization
Serial.println("initialisation complete."); delay(100);
delay(1000);
timer = millis();
}
@ -28,11 +30,11 @@ void loop()
if((millis()- timer) > 50){
timer = millis();
APM_BMP085.Read();
Serial.print("Pressure:");
Serial.print("Pressure:");
Serial.print(APM_BMP085.Press);
Serial.print(" Temperature:");
Serial.print(" Temperature:");
Serial.print(APM_BMP085.Temp / 10.0);
Serial.print(" Altitude:");
Serial.print(" Altitude:");
tmp_float = (APM_BMP085.Press / 101325.0);
tmp_float = pow(tmp_float, 0.190295);
Altitude = 44330 * (1.0 - tmp_float);