Loading...
Pages: 1 [2]   Go Down
Author Topic: Read integers from SD card  (Read 997 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am just a beginner so please don't ask me anything too difficult smiley-confuse

My in_char code snippet was copied from the internet and I'm afraid I never got it to work well which is why I stopped using it - but I can't remember what the exact problem was. Sorry I can't help.

Richard
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ou ok sorry .

Then a question to the parse int code. smiley-grin

Is it necessary to check if ( char == '\n') (newline) to read out one line at time individually to handle with the parameter, or with your code i dont need this? -> Is very important for me.

And what is WaitTime in your code? -> is this an delay time, that is content of the file?
« Last Edit: May 17, 2013, 04:41:47 am by milito » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code I posted is all you need to read 6 integers from the SD card - the last one is a delay I read from the SD card which I use in the program to delay each servo write for a predetermined period. The card contains the input file that has lines of 6 integers each.

I hope that helps.

Richard


Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah ok, that means i dont need to check up the newline, this will do automatically and after the delay the code will retrieve the next 6 integers?

A question, the output of parseInt is int, now i will to convert this to decimal so that i can convert this in byte, thats possible?
« Last Edit: May 17, 2013, 05:16:19 am by milito » Logged

Pages: 1 [2]   Go Up
Print
 
Jump to: