From 89f664e3b0dd8568326790b93063a6f7100dd475 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 11 Sep 2011 09:39:35 +1000 Subject: [PATCH] barometer: print a message on barometer init in example code this helps track down initialisation problems --- .../examples/APM_BMP085_test/APM_BMP085_test.pde | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libraries/APM_BMP085/examples/APM_BMP085_test/APM_BMP085_test.pde b/libraries/APM_BMP085/examples/APM_BMP085_test/APM_BMP085_test.pde index bab2661b19..4d2d23fd16 100644 --- a/libraries/APM_BMP085/examples/APM_BMP085_test/APM_BMP085_test.pde +++ b/libraries/APM_BMP085/examples/APM_BMP085_test/APM_BMP085_test.pde @@ -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);