FastSerial incompatability with SD Library

I have a ladyada GPS logger, with a Mediatek GPS from DIY Drones.

I updated my code for the GPS to run at 10 Hz, using the DIY Drones binary code, which works great.

When I added the SD card logging code back in , a compile errors are however generated unless the SD library and calls to the same were commented out. I compiled using the "relaxed" V22 Arduino IDE.

Looks like the FastSerial library is incompatible with the SD library.

I have extracted the setup code that checks for a an initialised SD card and opens a new file on the same. (Plus the code below which is used to write to the log file, which should be OK)

Can anyone assist with replacement code that will work with FastSerial - perhaps using Dataflash??

Thanks in anticipation

;

//#include <SD.h>  //***************FIX PROBLEM HERE***********************

#include <Wire.h>

#include <FastSerial.h>

/* 

  // see if the card is present and can be initialized:

  if (!SD.begin(chipSelect)) {

    Serial.println("Card init. failed!");

    error(1);

  }

   strcpy(buffer, "GPSLOG00.TXT");

  for (i = 0; i < 100; i++) {

    buffer[6] = '0' + i/10;

    buffer[7] = '0' + i%10;

    // create if does not exist, do not open existing, write, sync after write

    if (! SD.exists(buffer)) {

      break;

    }

  }

 logfile = SD.open(buffer, FILE_WRITE);

  if( ! logfile ) {

    Serial.print("Couldnt create "); Serial.println(buffer);

    error(3);

  }

  Serial.print("Writing to "); Serial.println(buffer);

 

 

 

 

**********Write to Log File*******************

// rad. lets log it!

      Serial.print(buffer);

      Serial.print('#', BYTE);

      digitalWrite(led2Pin, HIGH);      // sets the digital pin as output

       bufferidx++;

       logfile.write((uint8_t *) buffer, bufferidx);

       logfile.flush();

       if( != bufferidx) {

        putstring_nl("can't write!");

        error(4);

      }

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I'm having the same problem and would like to know if you could fix it.

    Thanks a lot.

This reply was deleted.

Activity