Detect GPS module

This commit is contained in:
Just Call Me Koko
2023-08-30 15:57:44 -04:00
parent 3c9458e0f5
commit 0106081308
6 changed files with 78 additions and 41 deletions

View File

@@ -17,8 +17,12 @@ void GpsInterface::begin() {
delay(4000);
while (Serial2.available())
Serial2.read();
if (Serial2.available()) {
Serial.println("GPS Attached Successfully");
this->gps_enabled = true;
while (Serial2.available())
Serial2.read();
}
}
void GpsInterface::showGPSInfo() {
@@ -82,6 +86,10 @@ bool GpsInterface::getFixStatus() {
return this->good_fix;
}
bool GpsInterface::getGpsModuleStatus() {
return this->gps_enabled;
}
void GpsInterface::main() {
while (Serial2.available()) {
//Fetch the character one by one