main
This commit is contained in:
@ -62,7 +62,8 @@ void onReceiveEvent(int bytes) {
|
||||
static uint8_t last_receive_cnt = 0;
|
||||
void update_sensor_data() {
|
||||
//gps
|
||||
if (millis() > 5000 && gps.charsProcessed() < 10 && digitalRead(GPS_POWER_PIN) == HIGH) {
|
||||
//if (millis() > 5000 && gps.charsProcessed() < 10 && digitalRead(GPS_POWER_PIN) == HIGH)
|
||||
if (millis() > 5000 && gps.charsProcessed() < 10) {
|
||||
sensor_data.gps_sta = 0x00; // 无设备
|
||||
sensor_data.gps_lat = 0.0f;
|
||||
sensor_data.gps_lon = 0.0f;
|
||||
@ -81,7 +82,8 @@ void update_sensor_data() {
|
||||
}
|
||||
|
||||
//测距
|
||||
if (receive_cnt == last_receive_cnt && digitalRead(RANGING_POWER_PIN) == HIGH) {
|
||||
//if (receive_cnt == last_receive_cnt && digitalRead(RANGING_POWER_PIN) == HIGH)
|
||||
if (receive_cnt == last_receive_cnt){
|
||||
sensor_data.height_sta = 0x00; // 无设备
|
||||
sensor_data.height = 0.0f;
|
||||
}else if (digitalRead(RANGING_POWER_PIN) == LOW){
|
||||
|
||||
Reference in New Issue
Block a user