Rokicki’s SD object is GREAT!

December 30th, 2006

I wrote a quick and dirty demo program for it that lists the files on an SD card’s root directory, and then shows the first five lines of text in the last file.

WOHOOO!!!!

I have unlimited (for all intents and purposes) storage for my Propellers!!!!!

 


‘ testsd.spin – quick test program of rokicki’s SD routines

‘ I tested with two files on the card, the fsrw.spin file, and the README.TXT file
‘ as you can see, it works 🙂

‘ Enjoy!

‘ Bill Henning
 

CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

obj
  tv: “tv_text”
  fs: “fsrw”

var
  byte filename[12]
 
pub start | i, ch, lines

  ‘ mount the SD card
 
  fs.mount(0)

  ‘start tv terminal

  tv.start(12)

  ‘write intro message
  tv.str(string(“*** SDIO Demo program. List files ***”,13,13))

Tadalafil Softgel Capsule takes barely 15 minutes to act, an action rate cialis order levitra that is commendable.Just one pill is consumed. If the flow of blood is not firm enough viagra cialis achat for being able to achieve penetration. If possible, canada cialis levitra try to use this remedy twice per day. DT’s can be prevented order generic viagra sale by the right treatment, but once the DT’s start, the analysis becomes harder.
  ‘open the directory
  fs.opendir

  ‘print the name of each file
  repeat
    if fs.nextfile(@filename)
       tv.str(string(13,”*** THEN SHOW 5 LINES OF LAST FILE ***”,13))
       quit
    else
       tv.str(@filename)
       tv.out(13)

  ‘open last file listed
  fs.popen(@filename,”r”)

  ch := 0
  lines := 0
 
  ‘ show text characters in it
  repeat while (ch > -1) & (lines < 6)     ch := fs.pgetc     if ((ch > 31)&(ch<128)) | (ch == 13)
      tv.out(ch)
    if (ch == 13)
      lines++

 


 

Would you believe my blog software won’t let me upload ‘.spin’ files as a potential security risk? I’ll upload it after I zip it. I also uploaded it as an attachment on the Parallax Propeller Forum.

Best,

Bill

 

 

Leave a Reply

You must be logged in to post a comment.