Writing a 18 bit variable onto an SD card
I am trying to write a stored varible onto my SD card.·
I have tried by using
··· sdfat.pwrite(string("torque: ",13),11)
··· sdfat.pwrite(string(@MyStr,13)18)
I am trying to save 18 Characters and delimit it with a return..
Could i get some direction on how I should proceed?
Thanks
I have tried by using
··· sdfat.pwrite(string("torque: ",13),11)
··· sdfat.pwrite(string(@MyStr,13)18)
I am trying to save 18 Characters and delimit it with a return..
Could i get some direction on how I should proceed?
Thanks
Comments
also 18 characters is 18*8 bits. note sure what code is used to write though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
In your first statement, you have 'string("torque: ",13)'. This is a 9 character string terminated by a zero byte. The first pwrite needs a matching count of 9.
In your second statement, you have 'string(@MyStr,13)'. I don't know what you're trying to do, but, if you're using something like Extended FullDuplexSerial and it's storing the input data in an array called 'MyStr', then '@MyStr' is already an address (what pwrite needs). You'd use 'sdfat.pwrite(@MyStr,strlen(@MyStr))'. This doesn't add a return. You could use 'sdfat.pputc(13)' for that.
If you're using some other routine that produces a string in a supplied byte array, this works the same way.