Writing Decimal Values to SD
Hi
Is is possible to write a decimal value directly to an SD card using Kwabena W. Agyeman SD card driver? I have tried sdfat.writebyte(count), where count has bee assigned a value. A character instead of the number is been stored.
Is is possible to write a decimal value directly to an SD card using Kwabena W. Agyeman SD card driver? I have tried sdfat.writebyte(count), where count has bee assigned a value. A character instead of the number is been stored.
Comments
sdfs.writeData(addressToGet, count)
pub writeDec(value) | i ' Output a decimal value if value < 0 -value sdfat.writebyte("-") i := 1_000_000_000 repeat 10 if value => i sdfat.writebyte(value / i + "0") value //= i result~~ elseif result or i == 1 sdfat.writebyte("0") i /= 10
Is it possible to check if a file exists before opening??
You can just open the file. Catch the error string and check the error code. If the error code is that the file does not exist then you know it does not exist.