Hi guys! i am making an NFC project with the adafruit nfc reader (here). I have one problem though, if i scan a tag, and then remove it too early, it restarts my arduino. I think i have found something regarding the restart, but i am not that good at code yet, so i don't know why it restarts. I hope you can help me with this.
when i scan a tag to the nfc reader, the reader blinks. if i remove the tag, when it blinks (while it reads), the whole arduino restarts.
My code is attached as a .ino file, if you want any other filetype, i will upload it again. ![]()
This is my Serial log:
ok
Entering reader
UID CHECK
UID
ReadPayLoad
er ok
So as you see, it prints "er" and then further out it prints "ok" which is the first thing it prints in the setup.
I suspect that the "er" comes from "err" which is from a library i use. it is used in the "NDEF.H" part of this library right here. It is on my personal dropbox, but you should be able to acess it. If you open the "ndef.h" file, you can search for "err" and it will pop right up.
It has to be right at the last second of the scan though. if i remove the tag almost instantly, it uses my "error" function properly, and the serial log ends like this:
Entering reader
ok
UID CHECK
UID
ReadPayLoad
err
ERROR
ERROR = 1
Reader Done!
Entering reader
I hope you guys are able to help me.
Thanks in advance.
-Kasper Røgen
Reader_Sound.ino (10.5 KB)