|
@ -16,7 +16,7 @@ void setup() { |
|
|
pinMode(MQ8, INPUT); |
|
|
pinMode(MQ8, INPUT); |
|
|
pinMode(MQ9, INPUT); |
|
|
pinMode(MQ9, INPUT); |
|
|
pinMode(MQ135, INPUT); |
|
|
pinMode(MQ135, INPUT); |
|
|
Serial.begin(9600); |
|
|
Serial.begin(115200); |
|
|
Serial3.begin(9600); |
|
|
Serial3.begin(9600); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -53,8 +53,10 @@ void loop() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
while (Serial3.available() > 0){ |
|
|
if (Serial3.available() > 0){ |
|
|
byte gpsData = Serial3.read(); |
|
|
String gpsData = Serial3.readStringUntil('\n'); |
|
|
Serial.write(gpsData); |
|
|
if (gpsData.startsWith("$GPRMC")){ |
|
|
|
|
|
Serial.println(gpsData); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|