Some general question
jimgolden
Posts: 4
Hello, I was wonding if I might be able to get some help with some qestions.
First, I have some experiance with programing these little black bugs that I have crawling all over my bread boards, and they are arduinos, chipkits, picaxe. But this spin is a little new to me. I am not sure how, but with some major luck, I was able to write to a sd card that I soldered some pins to and shoved in my bread board! That was lots of fun. So here are some questions about writing to the sd card
1. I do like being able to write to .csv files, I have some projects that will need this. So, Excel like the CSV, but when I put it in a string like
(string
With the arduino, If I were to print it or save it to the eeprom, I would just do something like "move levelmes to eeprom" I tried writing a var to the sd card but it said" String Char must range from 1 to 255" What do I use instead of string?
First, I have some experiance with programing these little black bugs that I have crawling all over my bread boards, and they are arduinos, chipkits, picaxe. But this spin is a little new to me. I am not sure how, but with some major luck, I was able to write to a sd card that I soldered some pins to and shoved in my bread board! That was lots of fun. So here are some questions about writing to the sd card
1. I do like being able to write to .csv files, I have some projects that will need this. So, Excel like the CSV, but when I put it in a string like
(string
sdfat.pputs(string( "123,234,345,56,4567,5,678,79,56,456,345,345,34,5,35,34,3,45,35" 13, 10 )]it puts every thing in row one. Will I need to place the 13, 10 part in between all the number like this to get it to work or will some other way work?
sdfat.pputs(string( "123" 13 "234" 13, 10 )2. How do I put something like a variable. IE..... I am monitoring the level of something and I want it to log that level that is being measured?
With the arduino, If I were to print it or save it to the eeprom, I would just do something like "move levelmes to eeprom" I tried writing a var to the sd card but it said" String Char must range from 1 to 255" What do I use instead of string?
Comments
For using variables, I suggest you look at the FullDuplexSerial object (in the OBEX but downloaded with PropTool). This works the same way and you have various conversions in spin to get variables into strings for sending serially. There is DEC, HEX, etc conversions. Now, Kye (the writer of the SDFAT object I believe you are using) has a string manipulation object and IIRC that comes with the FAT driver, and there are some demos for using it.
Once you get the variable into a string it is a simple matter to use sdfat.puts(strvar) where strvar is the variable in string format.
I hope this helps. If not, then please re-ask here for more help.
[code]
strx:=
sdfat.pputs(strx)
To write variables in form of decimal strings, you can use the "Simple_Numbers" object:
Andy
It's written for the PropBOE but you can just change the pin numbers to match your setup.