|
DovesLapTimer 4.0.0
GPS-based lap timing Arduino library — go-karts to race cars
|
#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]) |
| #define debug DEBUG_SERIAL.print |
| #define DEBUG_SERIAL Serial |
| #define debugln DEBUG_SERIAL.println |
| #define GPS_SERIAL Serial1 |
| #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
| unsigned long getGpsTimeInMilliseconds | ( | ) |
Returns the GPS time since midnight in milliseconds.
| 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.
| void gpsLoop | ( | ) |
| DovesLapTimer lapTimer | ( | crossingThresholdMeters | , |
| & | DEBUG_SERIAL | ||
| ) |
| void loop | ( | ) |
| void setup | ( | ) |
| 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 |
| unsigned long lastLapTime = -1 |