Go Down

Topic: Comparing data inside SD card with user Input (Read 216 times) previous topic - next topic

Rui_Teixeira

Mar 12, 2019, 10:54 pm Last Edit: Mar 12, 2019, 10:56 pm by Rui_Teixeira
Hello everyone, I'm having a little problem with a project im developing.
I have a SD card connected to Arduino through a shield. I can read the data inside of it but can't compare it with a value that an user will lately insert. I've found some code examples on some websites but it didn't help that much.
Can anyone give me an example of a code to make it work???

Thank you.

Paul_KD7HB

Can you give examples of the data you are trying to compare?

Paul

Rui_Teixeira

I'm trying to compare a hexadecimal value.
If you need more info send me a message and I'll provide it to you.

ieee488

I'm trying to compare a hexadecimal value.
If you need more info send me a message and I'll provide it to you.
No personal messaging should be required for something this simple.

You either know what you need or you don't.


.

Lucario448

I'm trying to compare a hexadecimal value.
Written as text or it's merely a binary comparison?

Rui_Teixeira

Written as text or it's merely a binary comparison?
It is written in a .txt file.

sterretje

As the file extension is txt, I guess that the data in there is ascii.
User entries are usually text as well.

If you want to compare text, you can use strcmp.

If one of them is not text, you can convert the text to a number using strtoul
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up