Shop OBEX P1 Docs P2 Docs Learn Events
Help getting mini sd card to work - Page 2 — Parallax Forums

Help getting mini sd card to work

2»

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 21:39
    You need to put a number in square brackets equal to the. Max number of bytes you want to read at once

    Byte nunret[noparse][[/noparse]6]

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

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 21:52
    I change my mind, I think it is how I display it since I can change the number 5 to 7 and it still shows the same thing. code:
    i:=sd.pread(@numret, 6)
    term.dec(numret)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 21:58
    If you have a propplug you can use full duplex serial to send data to terminal.

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

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 22:01
    I could, but I've never used it before. I am currently using a tv to find what is going on though. what should I try?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 22:27
    hmm, well, i found everytime i want to change the number I have to delete the folder first, but pread doesn't work, only pgetc does.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 22:30
    Show you whole code. My guess is you are not using buffers properly some how. They are an array of values not a single value.

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

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 23:42
    I played with it, and I figured it out, but it leads me to a question about writing variables to the memory. How come this:

    · i:=sd.pputc(62)
    · i:=sd.pputc(3)

    will only give me 62 when I read the memory? and if I run pgetc again after the first one getting 62 i get to the end of the file?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 00:23
    nevermind, i'm figuring out things on my own

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 01:01
    okay, here's an interesting question. if I have 2 saved to the file, and I run this code:
    sd.popen(string("code.bin"), "a")
    numret := 1
    i:=sd.pwrite(@numret, 1)
    it will treat the 1 from this program as one full byte, and add previous 2 from this program to it, giving me 258. everytime i run it it will do the same. can anybody explain it better for me?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-09 02:14
    Use numret[noparse][[/noparse]0]:=1

    Numret is a group of variables.


    As for your particular problem full code would be helpful

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

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 02:29
    lol i'm going mad and i dnt thnk u wnt to read a mad man's code. i've been pent up all day cuz whenever i go outside it will rain or just be too cold to enjoy. I'll try that numret, and if it doesn't work I'll load the code. Soon here I want to expirement with saving sensor values to the sd.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 02:35
    ok it didn't work so here is the code

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 05:01
    I get it now which is good because I'm tired of feeling like an idiot. Thanks for your help in guiding the clueless and hopefully I'll be able to take this wonderful knowledge and do something usefull with it. Now if you don't mind I will be running out of here screeming, get myself a couple cups of coffee, and have an allnighter here in my bedroom playing with the propeller. j/k

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-09 05:03
    Glad you figured it out. Good night

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

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-09 14:17
    Here is the code I came up with. The first one saves sensor values from a photoresistor and the second reads the sd card and displays all the numbers on the tv. When I am ready for it on my robot I will modify the code to save gps coordinates and obstacle data. When I create my ggp I will only need the reading program to find what led patterns and information·to display.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
Sign In or Register to comment.