FlexBASIC P2 uSD explore
I finally got my uSD to work on my P2 edge setup. Below is just a simple program to see if I am writing/reading anything to the uSD card.
I am using a 16GB uSD card, it seems to be reading and writing to the card without any problems, so far. With FlexBASIC, how large of a uSD card can it work with?
The next question, anybody have any FlexBASIC code to do things like DIR the card, delete files from the card, and so on.
Since, I think, it would not be practical to have some kind of mini editor, in FlexBASIC, is their a way to move files between _vfs_open_host() and _vfs_open_sdcardx(). I guess that way you could create a file on your host system, and then move the file to the uSD card, to be used with your program. This would be done without removing the uSD card.
' test1sd.bas OPTION EXPLICIT ' no implicitly dec'd vars CONST HEAPSIZE = 8192 ' lots of elbow room dim a$ as string dim i as ubyte dim msg$ as string msg$ = "Just some text." mount "/host", _vfs_open_host() mount ("/sd", _vfs_open_sdcardx(5,4,3,2)) ' mount the file system at /SD node ' write some stuff open "/sd/test.txt" for output as #2 'print #2, " " 'print #2, "This is another test line.";chr$(13) print #2, msg$;chr$(13) close #2 ' close the file 'read it all back print "Reading stuff from file..." open "/sd/test.txt" for input as #2 ' open for input do a$ = input$(1024, 2) ' get 1024 chars (or less if eof) print a$; ' print them loop until len(a$) = 0 ' keep going until eof close #2 ' close file for safety before exit print "Test done."