Page 1 of 1

Search bytes in EEprom (help with project)

Posted: Sun Feb 03, 2013 5:21 pm
by MJU
I'm building a Flowcode project and I'm struggling with following item:

In my Eeprom data is stored 7 bytes at the time.
The data starts @ position 0 and the next serie of seven bytes are stored @ position 7 and so on every 7 bytes.
Every serie of 7 bytes start with a byte that contains the number 1.

Now I want to search the Eeprom for a certain serie of bytes and return the starting point IF there is a match.
If there is no match it should also return a message (true/false).
It could be that there are only 3 or 4 series of the 7 bytes in the Eeprom.
For every first byte of a serie this starts at the 7the position from the previous and the first always starts at position 0.

How can I reliable and fast find IF such a serie exists (the serie I'm looking for is in a parameter[7] array-variable), and IF this exists at which Eeprom address it starts??

Any help is welcome..

Re: Search bytes in EEprom (help with project)

Posted: Sun Feb 03, 2013 9:35 pm
by Jan Lichtenbelt
Dear MJU

Something like this?

Kind regards

Jan Lichtenbelt

Re: Search bytes in EEprom (help with project)

Posted: Sun Feb 03, 2013 11:15 pm
by MJU
Thank you very much!
I'm going to test it tomorrow.

I see in this code: "= 0 // false"
What does the // mean?

Again thanks a lot!!

Re: Search bytes in EEprom (help with project)

Posted: Mon Feb 04, 2013 12:31 am
by Enamul
// is used to comment out anything in C code. Which you can use in calculation box as well to put comment.

Re: Search bytes in EEprom (help with project)

Posted: Mon Feb 04, 2013 11:36 am
by Jan Lichtenbelt
Dear MJU,

I'm sorry, but the boolean must be set to true (=1) at the first call, instead of false (=0)

Kind regards

Jan Lichtenbelt

Re: Search bytes in EEprom (help with project)

Posted: Mon Feb 04, 2013 11:39 pm
by MJU
Thank you so very much!