1. 프로젝트 사용한 보드 종류
nodemcu , ublox neo
2. 사용한 개발 프로그램명
아두이노 IDE
3. 사용한 센서 모델명
nodemcu , ublox neo-6m
4. 연결한 회로 설명 (또는 이미지)
5. 소스코드 (주석 필수)
#include <SoftwareSerial.h>
SoftwareSerial gpsSerial(10,11);
char c = "";
String str = "";
String targetStr = "GPGGA";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Start GPS... ");
gpsSerial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(gpsSerial.available())
{
c=gpsSerial.read();
if(c == '\n'){
if(targetStr.equals(str.substring(1, 6))){
Serial.println(str);
}
str = "";
}else{
str += c;
}
}
}
6. 문제점 및 에러 내용
업로드는 되는데 파싱부분에서 c가 먹히질 않아 시리얼모니터에 나오지가 않습니다 해결방법이 있을까요?
|