Hi Team,
I need help in understanding the way to read a text file saved on a SD Card.
The text file consists of 20 Voltage values from AN0 and the values are the converted to strings Float values of the voltage not the bit value,
example 1.85 ,2.56.4.9. etc
as shown here from the Console buffer when I open the file to read it ,as you can see the string in green ,the coma separator in purple(0x2C) and then there is a value 0x20 which seems to be a space ,I do not know why is this (I am using the write string to file function in code).
Now the problem I am having (also not sure how to do this) when reading the file with the stringRead function the first string is returned correctly then the comma is returend and then again the correct string is returned , there is always a miss read between the strings ,
any advise how to work with this SD card reads I will appreciate I have no clue what I am doing
SD cards File read problems
- p.erasmus
- Posts: 434
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: SD cards File read problems
Hello Peter,
Is it possible to post a simple example that shows the problem and I'll investigate what might be going wrong for you.
Is it possible to post a simple example that shows the problem and I'll investigate what might be going wrong for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: SD cards File read problems
Hi Ben
Thanks for your offer,I will make a small project with only this part from main application code.I am sure it is me not understanding how the SD card is populated with the data and how to retrieve it correctly your help will be appreciated
Thanks for your offer,I will make a small project with only this part from main application code.I am sure it is me not understanding how the SD card is populated with the data and how to retrieve it correctly your help will be appreciated
Regards Peter - QME Electronics
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: SD cards File read problems
Hi Ben,
Attached a simple read of 6 vales from the file starting at the first value,
you will noticed the first value is correct then it read only the comma(2C) then again a value and so on .
I know it is me doing somethings wrong because of limited knowledge of the SD cards also please help me understand in the console it shows the file length is 120 bytes when I read the length in the code it shows 512 Why ?
Thanks a million for helping out
Attached a simple read of 6 vales from the file starting at the first value,
you will noticed the first value is correct then it read only the comma(2C) then again a value and so on .
I know it is me doing somethings wrong because of limited knowledge of the SD cards also please help me understand in the console it shows the file length is 120 bytes when I read the length in the code it shows 512 Why ?
Thanks a million for helping out
Regards Peter - QME Electronics