And I need to convert that to a char to write it to a SD card I have tried this
file.writeLn((char*)MyArray));
But I get somthing like "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
And I need it to be "1111111111111"
Can somone point me in the right direction? Thanks
You can convert one byte into one char. You can not convert an array of bytes into an a char.
Typically, write() methods write binary data, and print() methods write ASCII data. Since you want ASCII data, you'll need to explain why you are using a write() method.
chrisnet:
And I need to convert that to a char to write it to a SD card I have tried this
file.writeLn((char*)MyArray));
But I get somthing like "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
If you look carefully you'll see umlauts/diareses over those "y"s - in my experience
that means they are 0xFF bytes, which is what unwritten flash reads as.
Did you flush your writes or close the file properly? I'd expect to see raw 0xFF's if
the writes hadn't been flushed out.
Because you can't send single char. Parameter for the function is a char* (a string array null terminated '\0')
uint16_t writeLn(char *st);
TinyFat library not have a function for write single char/byte.
You need to copy your 13 elements from your array to a string (array of char) and after write this variable/array using a single file.writeLn()
If you don't know what you are doing, I suggest you read the instructions. There are plenty of examples of arduino sketches to all kinds of writing to files. It is not too difficult to figure out what the error messages that you are getting mean.