Page 1 of 1
Read & Write to SDCard in order ?
Posted: Wed Jul 02, 2014 7:02 pm
by cucugwh
Hello.
I use Freematics OBD-II Adapter (GPS Capable) with BLE. (Firmware v2 : data logger)
I am searching to solution about to read from SDCard to smart device, then write OBD data to SDCard, in order .
Does anyone have good idea or solution?
Re: Read & Write to SDCard in order ?
Posted: Fri Jul 04, 2014 9:23 pm
by stanley
What do you mean by "read from SDCard to smart device"?
Re: Read & Write to SDCard in order ?
Posted: Mon Jul 14, 2014 1:47 pm
by cucugwh
Sorry. My Mistake. My English is not well.
I wanted to do that read to log data in sdcard and send to smart device.
anyway, I fined the solution that I want to do.
thank you.
Re: Read & Write to SDCard in order ?
Posted: Tue Jul 15, 2014 1:41 am
by BoxOfSnoo
cucugwh wrote:Sorry. My Mistake. My English is not well.
I wanted to do that read to log data in sdcard and send to smart device.
anyway, I fined the solution that I want to do.
thank you.
Can you share your solution?
Re: Read & Write to SDCard in order ?
Posted: Fri Aug 22, 2014 4:34 pm
by cucugwh
This code is sample.
if recvByte is 0x01, then do "CustomAction1"
CustomAction1 open file, send "SD File context" to target device(iOS, Android) use BLE
Sorry, My Answer is too late.
Code: Select all
void loop()
{
byte recvByte;
while(1){
if(SerialBLE.available())
{
recvByte = SerialBLE.read();
}
if(recvByte == 0x01){
//Custom Action1
delay(100);
sdfile = SD.open("Path of Your File ex:csv", FILE_READ);
if (!sdfile) {
return;
}
else
{
SerialBLE.print("datafile exist.");
while (sdfile.available()) {
SerialBLE.write(sdfile.read());
}
sdfile.close();
}
recvByte = 0x03;
}
if(recvByte == 0x02){
delay(100);
//Custom Action 2
}
}
}
Re: Read & Write to SDCard in order ?
Posted: Mon Dec 08, 2014 7:37 am
by Marek
Does it mean the Freematics OBD-2 adapter is capable of dumping info onto sdcard and then read the file and send it via BT to a connected BT device?
Re: Read & Write to SDCard in order ?
Posted: Thu Aug 06, 2015 9:37 pm
by Dhruvee
Your thread not clear me so much. If you know more about sd card must visit my website.