You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
664 B
31 lines
664 B
#include "Copter.h" |
|
|
|
|
|
void Copter::zr_app_1hz() |
|
{ |
|
static bool before_fly = true; |
|
if(motors->armed()){ |
|
if(before_fly){ |
|
before_fly = false; |
|
} |
|
relay.on(3); // 电子开关,保持通路 |
|
// camera.set_in_arm_mode(true); |
|
}else{ |
|
relay.off(3); |
|
if(before_fly){ |
|
uint8_t bat_cnt = zr_app.get_battery_capacity(1,battery.voltage()); |
|
battery.reset_remaining(0,(float)bat_cnt ); |
|
// gcs().send_text(MAV_SEVERITY_INFO, "bat:%.2f,pst%d,%.2f",battery.voltage(),bat_cnt,(float)bat_cnt); |
|
} |
|
} |
|
|
|
} |
|
|
|
void Copter::zr_app_10hz() |
|
{ |
|
|
|
|
|
} |
|
void Copter::zr_app_50hz(){ |
|
|
|
} |