DovesLapTimer 4.0.0
GPS-based lap timing Arduino library — go-karts to race cars
Loading...
Searching...
No Matches
real_track_data_debug.ino File Reference
#include <stdlib.h>
#include <string.h>
#include <Adafruit_GPS.h>
#include <DovesLapTimer.h>
#include "gps_race_data_2laps.h"

Macros

#define debug   DEBUG_SERIAL.print
 
#define DEBUG_SERIAL   Serial
 
#define debugln   DEBUG_SERIAL.println
 
#define GPS_SERIAL   Serial1
 
#define HAS_DEBUG
 

Functions

unsigned long getGpsTimeInMilliseconds ()
 Returns the GPS time since midnight in milliseconds.
 
char * gpsLastFakeNMEA ()
 
void gpsLoop ()
 
DovesLapTimer lapTimer (crossingThresholdMeters, &DEBUG_SERIAL)
 
void loop ()
 
void setup ()
 

Variables

const double crossingPointALat = 28.41270817056385
 
const double crossingPointALng = -81.37973266418031
 
const double crossingPointBLat = 28.41273038679321
 
const double crossingPointBLng = -81.37957048753776
 
double crossingThresholdMeters = 7.0
 
bool done = false
 
Adafruit_GPS * gps = NULL
 
static int last_processed_line = -1
 
unsigned long lastLapTime = -1
 
const int num_gps_logs = sizeof(gps_logs) / sizeof(gps_logs[0])
 

Macro Definition Documentation

◆ debug

#define debug   DEBUG_SERIAL.print

◆ DEBUG_SERIAL

#define DEBUG_SERIAL   Serial

◆ debugln

#define debugln   DEBUG_SERIAL.println

◆ GPS_SERIAL

#define GPS_SERIAL   Serial1

◆ HAS_DEBUG

#define HAS_DEBUG

Real debug using adafruit GPS library without a GPS connected

Will probably be cleaned up... eventually... to replace current unit-test suite

3 different data-sets available

Function Documentation

◆ getGpsTimeInMilliseconds()

unsigned long getGpsTimeInMilliseconds ( )

Returns the GPS time since midnight in milliseconds.

Returns
unsigned long The time since midnight in milliseconds

◆ gpsLastFakeNMEA()

char * gpsLastFakeNMEA ( )

Returns the next NMEA data string from a pre-defined array of GPS logs. The function stores the logs in a global array and keeps track of the last processed line using a static variable. Each time the function is called, it returns the next line in the array until all the lines have been processed. If there are no more lines to process, the function returns NULL.

Returns
A pointer to a static buffer containing the next NMEA data string from the array, or NULL if there are no more lines to process. The buffer is reused on each call, so copy data if needed.

◆ gpsLoop()

void gpsLoop ( )

◆ lapTimer()

DovesLapTimer lapTimer ( crossingThresholdMeters  ,
DEBUG_SERIAL 
)

◆ loop()

void loop ( )

◆ setup()

void setup ( )

Variable Documentation

◆ crossingPointALat

const double crossingPointALat = 28.41270817056385

◆ crossingPointALng

const double crossingPointALng = -81.37973266418031

◆ crossingPointBLat

const double crossingPointBLat = 28.41273038679321

◆ crossingPointBLng

const double crossingPointBLng = -81.37957048753776

◆ crossingThresholdMeters

double crossingThresholdMeters = 7.0

◆ done

bool done = false

◆ gps

Adafruit_GPS* gps = NULL

◆ last_processed_line

int last_processed_line = -1
static

◆ lastLapTime

unsigned long lastLapTime = -1

◆ num_gps_logs

const int num_gps_logs = sizeof(gps_logs) / sizeof(gps_logs[0])