I appreciate how tempting it is to use other's code, but this can be dangerous if you aren't clear on how every step works - consider if it HAD worked, but through some oversight, left the doors to open with any card with a 1 in the fourth position or other flaw - unlikely in this case, but do you see my point? My suggestion would be:
Limit your ID to 1 tag and 1 "buf", start by IDing only the first character then, when that works, build a loop to check all 10 characters of one tag (or until the first mismatch). Consider blinking an LED as each character is checked and, perhaps adding a second red led to flash when a character match fails. This modular approach works very well for me and helps my understanding keep up with increasingly complex code. Also, if 80% of the code worked as expected before the last 20% was added, it is much easier to determine what I did that didn't result in what i expected to happen happening. This technique is very much like how most people make sense of complex sentances as well. Of course, then add the final loop that loops through each card DATA statement - similar to what you have now.
I think that EarlyBird2's posts here are with some of the best I've ever read. The need and willingness to study not only the function, but the logic behind the function is what seperates amateurs like me from professionals like him - and avoids the need to recall millions of cars because of some issue not discovered until FAR too late..
Bookmarks