Go Down

Topic: Saving AT Command to SD Card (Read 128 times) previous topic - next topic

MarcLeoden

I hope someone could help me on saving the received text from the gsm to sd card. I have an attached file of my code.

Lucario448

Dumping a data stream from a serial source is as simple as:
Code: [Select]
// Open the file for writting first

byte data;

while (Serial.available())
{
  data = Serial.read();
  dataFile.write(data);
  mySerial.write(data);//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
  data = mySerial.read();
  dataFile.write(data);
  Serial.write(data);//Forward what Software Serial received to Serial Port
}

This way data streams from both directions are logged and still correctly piped to each port.

Go Up