Пример #1
0
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);
}
Пример #2
0
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));
    }
}