Added temperature to the Airspeed.cpp example script

Fixed the formatting of the output data
This commit is contained in:
AndersonRayner 2016-03-28 12:09:37 +11:00 committed by Lucas De Marchi
parent 2b77bc02bf
commit 74b9f624a3
1 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,8 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
static AP_Vehicle::FixedWing aparm; static AP_Vehicle::FixedWing aparm;
float temperature;
AP_Airspeed airspeed(aparm); AP_Airspeed airspeed(aparm);
void setup() void setup()
@ -47,7 +49,9 @@ void loop(void)
if((AP_HAL::millis() - timer) > 100) { if((AP_HAL::millis() - timer) > 100) {
timer = AP_HAL::millis(); timer = AP_HAL::millis();
airspeed.read(); 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); hal.scheduler->delay(1);
} }