From 043691660913a8cf850626488d7a141d7df07de4 Mon Sep 17 00:00:00 2001 From: jasonshort Date: Mon, 14 Feb 2011 00:43:35 +0000 Subject: [PATCH] updated formatting, baud git-svn-id: https://arducopter.googlecode.com/svn/trunk@1643 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- .../APM_BMP085_test/APM_BMP085_test.pde | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 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 29b10b3f65..bab2661b19 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 @@ -1,43 +1,42 @@ -/* - Example of APM_BMP085 (absolute pressure sensor) library. - Code by Jordi Muñoz and Jose Julio. DIYDrones.com -*/ - -#include -#include // ArduPilot Mega BMP085 Library - -APM_BMP085_Class APM_BMP085; - -unsigned long timer; - -void setup() -{ - APM_BMP085.Init(); // APM ADC initialization - Serial.begin(57600); - Serial.println("ArduPilot Mega BMP085 library test"); - delay(1000); - timer = millis(); -} - -void loop() -{ - int ch; - float tmp_float; - float Altitude; - - if((millis()- timer) > 50) - { - timer=millis(); - APM_BMP085.Read(); - Serial.print("Pressure:"); - Serial.print(APM_BMP085.Press); - Serial.print(" Temperature:"); - Serial.print(APM_BMP085.Temp/10.0); - Serial.print(" Altitude:"); - tmp_float = (APM_BMP085.Press/101325.0); - tmp_float = pow(tmp_float,0.190295); - Altitude = 44330*(1.0-tmp_float); - Serial.print(Altitude); - Serial.println(); - } -} +/* + Example of APM_BMP085 (absolute pressure sensor) library. + Code by Jordi MuÃ’oz and Jose Julio. DIYDrones.com +*/ + +#include +#include // ArduPilot Mega BMP085 Library + +APM_BMP085_Class APM_BMP085; + +unsigned long timer; + +void setup() +{ + APM_BMP085.Init(); // APM ADC initialization + Serial.begin(38400); + Serial.println("ArduPilot Mega BMP085 library test"); + delay(1000); + timer = millis(); +} + +void loop() +{ + int ch; + float tmp_float; + float Altitude; + + if((millis()- timer) > 50){ + timer = millis(); + APM_BMP085.Read(); + Serial.print("Pressure:"); + Serial.print(APM_BMP085.Press); + Serial.print(" Temperature:"); + Serial.print(APM_BMP085.Temp / 10.0); + Serial.print(" Altitude:"); + tmp_float = (APM_BMP085.Press / 101325.0); + tmp_float = pow(tmp_float, 0.190295); + Altitude = 44330 * (1.0 - tmp_float); + Serial.print(Altitude); + Serial.println(); + } +}