From 74b9f624a3671cb9568d96b96b7616bb0981e2ad Mon Sep 17 00:00:00 2001 From: AndersonRayner Date: Mon, 28 Mar 2016 12:09:37 +1100 Subject: [PATCH] Added temperature to the Airspeed.cpp example script Fixed the formatting of the output data --- libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp b/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp index 206e71b6a2..2049c79f89 100644 --- a/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp +++ b/libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp @@ -27,6 +27,8 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL(); static AP_Vehicle::FixedWing aparm; +float temperature; + AP_Airspeed airspeed(aparm); void setup() @@ -47,7 +49,9 @@ void loop(void) if((AP_HAL::millis() - timer) > 100) { timer = AP_HAL::millis(); airspeed.read(); - hal.console->printf("airspeed %.2f healthy=%u\n", airspeed.get_airspeed(), airspeed.healthy()); + airspeed.get_temperature(temperature); + + hal.console->printf("airspeed %5.2f temperature %6.2f healthy = %u\n", airspeed.get_airspeed(), temperature, airspeed.healthy()); } hal.scheduler->delay(1); }