Shop OBEX P1 Docs P2 Docs Learn Events
Accessing SD files using I/O — Parallax Forums

Accessing SD files using I/O

StokedcatStokedcat Posts: 3
edited 2009-06-10 14:05 in Propeller 1
Hi All,

My 1st post and I'm sure it won't be my last .

I have purchased the u-Oled 96 Prop board created my bmp and some dat files and stored them on an SD card......easy so far.

Now I want to access the the bmp's and or dat files to show the graphics when I change state of the 4 i/o pins on the u-Oled 96.

I have used the Rs232 spin files and the excellent Rs232 pc interface to call my files great works fantastic.

However I am really struggling to simplifiy it and utilise the SD commands without the RS232 interface and make it a simple stand alone device controlled only by the i/o pins etc.....I can expand the i/o later by using a shift register or something.

Any help would be appreciated ......this is my 1st project and I'm close but no cigar...my main problem is accessing the SD card using I/O.

Hope this is clear what I'm trying to achieve.

Thanks for any help you can give me.

confused.gif

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-06-10 13:34
    there is an sd fat object in the obex.

    !!usd.spin will toggle all the io lines in a few test paterns and check for an sd card on p0-p3.

    don't have that screen but this may help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are now in stock. Only $30. PCB available for $5

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • StokedcatStokedcat Posts: 3
    edited 2009-06-10 13:47
    Thanks I'll give it a try and let you know how I get on

    Cheers
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-06-10 13:55
    Nope ... it's not very clear what you want.

    Is it that you want to show different pictures in case the I/O pins change?
    0000 -> show pic 0
    0001 -> show pic 1
    ... and so on ...

    Or do you want it mor like the buttons on an MP3 player:
    0001 -> start/stop looping through the pictures
    0010 -> next picture
    0100 -> previous picture
    1000 -> ?

    What's connected to the I/Os? Buttons? Another controller? Parallel interface of a PC?

    In both cases you need to recognize a change in the I/Os, so you can start with a loop that scans the I/O pins for a change
    oldval := INA[noparse][[/noparse] pin0 ... pin4 ]
    repeat
      waitpne( pinmask, oldval ) ' this waits until at least one of the I/Os changed
      ' missing: debounce in case you have buttons attached
      
      oldval := INA[noparse][[/noparse] pin0 ... pin4 ] ' read the new state of I/O pins (which is then the old value for the next iteration)
      case oldval
         %0000:
            'donothing
         %0001:
            'startstop
         %0010:
            ' forward
         %0100:
            ' backward
       
    
    



    Post Edited (MagIO2) : 6/10/2009 2:01:15 PM GMT
  • StokedcatStokedcat Posts: 3
    edited 2009-06-10 14:05
    Hi

    Your right on both counts I suppose.

    it's buttons changing state from 0 to vcc and calling images, but perhaps using the other other method of up/down etc might be better?

    Thanks for the guidance on the I/O


    Cheers
    smile.gif
Sign In or Register to comment.