This commit is contained in:
2025-06-18 14:45:24 +08:00
parent 09a02b68a8
commit d0d2f216d2
2 changed files with 11 additions and 8 deletions

View File

@ -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){