Predicitive Arduino GPS Lap Timer (Test)

Test

My Arduino-based (Mega) predictive GPS lap timer under test using an Arduino (168 Duemilanove) as the scripted GPS Simulator.

Main loop of code:

void loop(void) {
  uint8_t gps_string_index;

  gps_string_index = 0;
  while(1) {
    uint8_t i;

    if ((i = Serial.available())) {
      while(i--) {
      char c;

      c = Serial.read();
      gps_string[gps_string_index++] = c;
      if (c == '\n') {
        gps_string_index = 0;
        //process gps string here
        switch (mode) {
          case PRESTART_MODE:
          case STOPPED_MODE:
            PreStart();
            break;
          case RUNNING_MODE:
            Run();
            break;
          case GPS_INIT_MODE:
          default:
            GPSInit();
            break;
        }
#ifdef DEBUG
        //debug output gps string
        for (int i=0; i<strlen(gps_string); i++)
          Serial.print(gps_string[i]);
#endif
        }
      }
    }
  }
}
Advertisements

About Jim Eli

µC experimenter
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

One Response to Predicitive Arduino GPS Lap Timer (Test)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s