starletakias
Member +
has anyone start project to see the temperatures and pressure on starlet?
see now that is cool.No, but I've used the SSD1306 OLED screens to do similar things for having a real time clock on the Starlet.
#define EXPECTED_FIELDS 12
#define GPRMC "$GPRMC"
#define BUF_SIZE 512
struct gprmc {
char timestamp[GPRMC_BUF],
validity,
latatitude[GPRMC_BUF],
longitude[GPRMC_BUF],
norSou,
easWes,
speed[GPRMC_BUF],
course[GPRMC_BUF],
date[GPRMC_BUF],
variation[GPRMC_BUF],
moreEastWest,
checkSum[GPRMC_BUF];
bool succcess;
};
/*
* @brief Process the $GPRMC line
*
* @param gprmc - The struct used to house everything
* @return success - A flag used to indicate the success of the subroutine
*/
static struct gprmc parseLine(char *line) {
struct gprmc gps = { { 0 }, 0, { 0 }, { 0 }, 0, 0, { 0 }, { 0 }, { 0 }, { 0 }, 0, { 0 }, 0 };
int fields = 0;
fields = sscanf(line, "$GPRMC,%[^,],%c,%[^,],%c,%[^,],%c,%[^,],%[^,],%[^,],%[^,],%c,%[^,]\n", gps.timestamp, &gps.validity, gps.latatitude, &gps.norSou, gps.longitude, &gps.easWes, gps.speed, gps.course, gps.date, gps.variation, &gps.moreEastWest, gps.checkSum);
if(EXPECTED_FIELDS == fields)
gps.success = true;
return gps;
} /* End of parseLine */
/*
* @brief Search through the GPS looking for the line $GPRMC
* And extract it.
*
* @param file - The file where the GPS information can be found
* @param line - The buffer to place to the contents in to
* @return found - A flag indicating whether or not the contents could be found
*/
static bool yankLine(FILE *fp, char *line) {
bool found = false;
int loopCounter = 0;
char buff[BUF_SIZE] = { 0 }, *offset = NULL;
while(false == found || LOOP_MAX == loopCounter) {
fgets(buff, BUF_SIZE, fp);
if(NULL != buff) {
offset = strstr(buff, GPRMC);
/* Date Found */
if(NULL != offset) {
memcpy(line, buff, BUF_SIZE);
found = true;
}
}
memset(buff, '\0', BUF_SIZE);
++loopCounter;
}
return found;
} /* End of yankLine */
Yeah, seems easy enough to me. Those OLED displays are pretty simple when using the Adafruit library.hi thats cool
but i wand to connect sensors with lsd with arduino uno