1
0

Add GPS module support: implement GPS_Init, GPS_Read, and GPS_Data functions

This commit is contained in:
AlejandroJose2001
2025-04-11 10:47:10 +02:00
parent 0390edbb97
commit 63fda936bb
2 changed files with 30 additions and 0 deletions

5
hardware/include/GPS.hpp Normal file
View File

@@ -0,0 +1,5 @@
#define RX 4
#define TX 5
#include <SoftwareSerial.h>
void GPS_Init();

25
hardware/src/GPS.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "GPS.h"
char c = "";
void GPS_Init(){
SoftwareSerial gps(RX, TX); // RX, TX
Serial.begin(9600);
gps.begin(9600);
Serial.println("GPS Initialized");
}
void GPS_Read(){
if (gps.available()) {
c = gps.read();
}
}
String GPS_Data(char data){
char[] c = data.split(",");
float lon = c[2];
}