void AP_OSD_Screen::draw_aspd2(uint8_t x, uint8_t y) { AP_Airspeed *airspeed = AP_Airspeed::get_singleton(); if (!airspeed) { return; } float asp2 = airspeed->get_airspeed(1); if (airspeed != nullptr && airspeed->healthy(1)) { backend->write(x, y, false, "%c%4d%c", SYM_ASPD, (int)u_scale(SPEED, asp2), u_icon(SPEED)); } else { backend->write(x, y, false, "%c ---%c", SYM_ASPD, u_icon(SPEED)); } }
void loop(void) { static uint32_t timer; if ((AP_HAL::millis() - timer) > 100) { timer = AP_HAL::millis(); airspeed.read(); 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); }
void AP_OSD_Screen::draw_atemp(uint8_t x, uint8_t y) { AP_Airspeed *airspeed = AP_Airspeed::get_singleton(); if (!airspeed) { return; } float temperature = 0; airspeed->get_temperature(temperature); if (airspeed->healthy()) { backend->write(x, y, false, "%3d%c", (int)u_scale(TEMPERATURE, temperature), u_icon(TEMPERATURE)); } else { backend->write(x, y, false, "--%c", u_icon(TEMPERATURE)); } }