PDA

View Full Version : Examples of SD read/write?



Oldbitcollector (Jeff)
09-17-2007, 10:56 AM
Can someone suggest best examples of reading and writing data from the SD?

I'd like to take keyboard data key by key and append it to an SD file.
Also read and display files.

Thanks!
Oldbitcollector

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

— Calvin, of 'Calvin and Hobbes.

Mike Green
09-17-2007, 11:42 AM
I don't know if it's a "best example", but both FemtoBasic and BoeBotBasic read and write single bytes from and to an SD card file. Have a look at the OPEN / CLOSE / READ / WRITE statement routines in either one (from the Object Exchange). There's a large CASE statement with all of the statements implemented in it ... look there. There are also routines to load and save Basic programs to SD files in source code form.

Mark Bramwell
09-17-2007, 11:43 AM
Check out "FAT16 routines with secure digital card layer" in the Object Exchange. Very well done and fast. It has some short demos to show how it works. I am using it and it didn't take long.

I purchased a $5 USB key that was a SD reader. I opened, used double-sided tape and attached it to my PropRPM board. I attached a few connecting wires to the socket and I was in business. The object got me going in minutes.

Oldbitcollector (Jeff)
09-17-2007, 11:50 AM
Thanks guys! Great leads! I'm up and running..

Oldbitcollector

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

— Calvin, of 'Calvin and Hobbes.