Troubles convert a long into string for C3 + SD-Card (write string to file (sdcard)
nomad
Posts: 276
hi,
i am working with the C3-board and the SD-Card
please have a look to my oldThread " Troubles with PropC3 and SD-Card"
i am working with c3-quadV2-SD-01.spin (its adapted from ggg558877)
and with dave_fsrw.spin (from Dave Hein)
in the moment the code works with static strings
a) in the DAT Section or
b) str := "4"
all stuff ok
but i would work with my DummyDatas (aka GPS-Datas) as
Long latfloat := 47.51332
in the "dave_fsrw.spin" - drive
i can do with
sdcard.pputs(@str) or
sdcard.pwrite(@str,8)
but i have big troubles to convert the latfloat to a stringBuffer which is correct
for pputs or pwrite ?
in the c3-quadV2-SD-01.spin you find some experiments
result : not printable chars ?
have somebody a way to solve this problem ?
attachments:
- c3-quadV2-SD-01.spin
- dave_fsrw.spin
thanks for help and hints
regards nomad
i am working with the C3-board and the SD-Card
please have a look to my oldThread " Troubles with PropC3 and SD-Card"
i am working with c3-quadV2-SD-01.spin (its adapted from ggg558877)
and with dave_fsrw.spin (from Dave Hein)
in the moment the code works with static strings
a) in the DAT Section or
b) str := "4"
all stuff ok
but i would work with my DummyDatas (aka GPS-Datas) as
Long latfloat := 47.51332
in the "dave_fsrw.spin" - drive
i can do with
sdcard.pputs(@str) or
sdcard.pwrite(@str,8)
but i have big troubles to convert the latfloat to a stringBuffer which is correct
for pputs or pwrite ?
in the c3-quadV2-SD-01.spin you find some experiments
result : not printable chars ?
have somebody a way to solve this problem ?
attachments:
- c3-quadV2-SD-01.spin
- dave_fsrw.spin
thanks for help and hints
regards nomad
spin
23K
Comments
thank you for your help :-)
today i make with your snippets some experiments
and make then a reply
regards
nomad
many thanks for your code.
its running with
- 1 write dummyDatas (lat,lon,alti) into gps1.txt of the SD-Card
- 2 read dummyDatas in 1 line to PST
--- code
- WRITE
sdcard.pputs(fstr.FloatToString(latfloat))
sdcard.pputs(" ")
sdcard.pputs(fstr.FloatToString(lonfloat))
sdcard.pputs(" ")
sdcard.pputs(fstr.FloatToString(GPSaltitude))
- READ to PST
bytefill(@sbuf, 0, BUF_SIZE) ' clear buffer
readln(@sbuf, 80) ' read line from file
term.str(@sbuf)
as attachment a screenshot as
- test-kuroneko-2701.jpg
thanks for your help :-))
regards
nomad