Bonjour, grace à un programme créer par nos soins, nous arrivons à recevoir des trames gps et à isoler les trames GPRMC.
Nous avons 2 problèmes, nous voulons enregistrer les trames GPRMC recus sur le moniteur série sur une carte SD.
Les trames GPRMC recus ont deux caractères "$" au lieu d'un à chaque début de trames, ce qui est problèmatique car les convertisseurs gpx ne parvient pas à convertir nos fichiers txt en gpx si notre trames contient 2 caractères "$"
Merci de votre aide
bonjour,
tu déclares ta chaine en String et tu efface le 1er caractère.
pas testé, mais essaye ca
String GPRMC = "$13415464";
GPRMC.remove(0,1);
#include <SoftwareSerial.h>
SoftwareSerial SoftSerial(10,11);
unsigned char buffer[64];
int count=0;
int toto=0;
char currentchar;
void setup() {
SoftSerial.begin(9600);
Serial.begin(9600);
}
void loop() {
getGPS();
}
void getGPS() {
if (SoftSerial.available())
{
while(SoftSerial.available())
{
if(toto=1){
currentchar=SoftSerial.read();
if(currentchar == '
Où faudrait-il mettre ça?)
{
if(buffer[1] == '
Où faudrait-il mettre ça? && buffer[2] == 'G' && buffer[3] == 'P' && buffer[4] == 'R' && buffer[5] == 'M' && buffer[6] == 'C'){
Serial.println(count);
Serial.write(buffer,count);
}
clearBufferArray();
count = 0;
toto = 0;
buffer[count++]='
Où faudrait-il mettre ça?;
toto = 1;
}
buffer[count++]=currentchar;
if(count == 64){
break;
}
}
else
{
currentchar = SoftSerial.read();
if(currentchar == '
Où faudrait-il mettre ça?)
{
buffer[count++]='
Où faudrait-il mettre ça?;
toto = 1;
}
}
}
}
}
void clearBufferArray()
{
for (int i=0; i<count;i++)
{ buffer[i]=NULL;}
}
Où faudrait-il mettre ça?