saving data on SD card waste my time about 15 milliseconds. If I can convert bytes of data into audio waveform and storing into audio recorder, This may solve my problem.
How about starting with realistic expectations? You can not convert gyroscope data to audio data.
Even if you could, which is not necessary since bytes are bytes, not matter what the data is really meant to be interpreted as, where would you store the data?
How would you get the data from the Arduino to that device?
any device that can record audio. (mobile, mp3 player, sound recorder...)
So, you think that you can send the gyroscope data to a speaker, and have a recorder with microphone record the speaker output, and then, somehow or other, you'll convert the recorded information back to gyroscope data.
PaulS:
So, you think that you can send the gyroscope data to a speaker, and have a recorder with microphone record the speaker output, and then, somehow or other, you'll convert the recorded information back to gyroscope data.
See reply #2.
no no...
I want to send data into a pin and connect pin directly to a input microphone jack of recoreder.
Digital data can be encoded and stored on an audio device (anyone remember the Sinclare Zx-81?). but it is gonna be waaaaay slooooower than writing to an SD card file.
MP3 is a "lossy" storage format. What comes out sounds very much like what went in but the actual digital samples are different to the original. You can't record anything except audio. The "sounds like" is the critical thing with MP3. Other types of data will be totally scrambled because they don't sound like anything.
Browse over to the "Storage" forum and look through the old threads there on how to efficiently log data to SD cards at high speed. You can get at least 100x speedup from the default SD library if you are willing to work for it.
Don Lacaster did something like this years ago - see his website. I think he managed about 2400 baud.
Or, for something more recent, google 'micromodem'
Allan.
There are faster tape recorders, the high speed data cassettes that were made for computer use. I did some work at an insurance company data center where they had neat automated racks on readers for them. They also had tape reels and carts to wheel them from the library and back. For some of my hours I used those to make microfiche records.
How long does it take that code to read 32 bytes via I2C? I see the get commands, they wait.
GoForSmoke:
I'd expect recording on tape to be way slower than to SD.
123Splat:
Digital data can be encoded and stored on an audio device (anyone remember the Sinclare Zx-81?). but it is gonna be waaaaay slooooower than writing to an SD card file.
Sorry my friend, but it is a NO GAIN solution.
many thanks for your reply...
MorganS:
MP3 is a "lossy" storage format. What comes out sounds very much like what went in but the actual digital samples are different to the original. You can't record anything except audio. The "sounds like" is the critical thing with MP3. Other types of data will be totally scrambled because they don't sound like anything.
Browse over to the "Storage" forum and look through the old threads there on how to efficiently log data to SD cards at high speed. You can get at least 100x speedup from the default SD library if you are willing to work for it.
What does the Android run on? What is the data rate? Is it stereo 16 bit 44KHz? That's 705600.
Do you think it will beat SD that runs at 4 MHz by default?
SD is not a hard drive, those flush commands will slow down SD writing because of wear balancing. Just write to SD and let the library deal with the buffer. You need to close and open the file once in a while to update the FAT, anything not updated gets lost on power out/reset but you should have data up to the last close.
Have you tried just collecting raw data from the gyro and printing to serial monitor just 20x a second a complete set of the gyro data? 1.69 IDE lets Serial run 260000 baud, 1300 chars 20x a second. SD allowed to burst write continuous blocks is faster.