Multiple Serial Communication issues

I am working on an autonomous robot that follows a previously driven path. So I have a somewhat working piece of code that uses a joystick to drive the robot around and I am using the MarvelMind Navigation System to record its position and send it to the arduino to save to an Adafruit SD card data logger. Now I need to keep the MarvelMind beacon unconnected to the Arduino until the SD card logger boots up completely and finds the file which is an issue that I think is related to the one I’ll describe farther down. I am then pretty much looping where I check for a new location, open the file, save the location, and close the file. I think since its going in that order it is working fine and not interfering. However, for my autonomous navigation code I have the .csv file on the SD logger open the entire time so I can read it line by line. I believe this is causing the SD Logger and Marvelmind beacon serial connection to interfere with each other. I am using an Arduino Mega 2560 and have the marvelmind beacon connected to pin 0 and ground on the arduino. Does anyone have tips on how to overcome this issue? I don’t see an easy way to switch the serial port of the marvel mind beacon or the SD card but maybe there is I am not aware of as I don’t completely understand all of the code being used for the Marvelmind beacon that was provided by them. I will paste attach my code as it was too long to paste in here.

navigate.ino (12 KB)

It's pretty hard to see what your serial problem is, but the solution is not likely to be found in the beacon. From the way you describe it, it simply sends out a data stream without knowing or caring about what is receiving, if anything. There is no need to switch any serial port on the beacon as you imply, and probably isn't one to switch to anyway. The Mega, on the other hand, has four hardware serial ports you can use, and you simply connect the beacon to any one of them, and then alter your relevant serial commands to suit.

while serial1 available  //for example

@cole18, the text in your Original Post is just a jumble of thoughts that is almost impossible to make sense of. See how much easier it is when you use whitespace to separate the the different thoughts

I am working on an autonomous robot that follows a previously driven path. So I have a somewhat working piece of code that uses a joystick to drive the robot around and I am using the MarvelMind Navigation System to record its position and send it to the arduino to save to an Adafruit SD card data logger.

Now I need to keep the MarvelMind beacon unconnected to the Arduino until the SD card logger boots up completely and finds the file which is an issue that I think is related to the one I'll describe farther down.

I am then pretty much looping where I check for a new location, open the file, save the location, and close the file. I think since its going in that order it is working fine and not interfering.

However, for my autonomous navigation code I have the .csv file on the SD logger open the entire time so I can read it line by line. I believe this is causing the SD Logger and Marvelmind beacon serial connection to interfere with each other.

I am using an Arduino Mega 2560 and have the marvelmind beacon connected to pin 0 and ground on the arduino. Does anyone have tips on how to overcome this issue?

I don't see an easy way to switch the serial port of the marvel mind beacon or the SD card but maybe there is I am not aware of as I don't completely understand all of the code being used for the Marvelmind beacon that was provided by them.

I will paste attach my code as it was too long to paste in here.

...R

A link to the datasheet or documentation for the MarvelMind Navigation System seems essential for anyone to be able to help.

The Mega has 3 spare HardwareSerial ports - why not use them? Pins 0 and 1 are used for communication with the PC and for uploading programs so it is best not to use them for anything else.

…R