Skip to content

Add support to 'listen' for tags #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dunkmann00 opened this issue Jul 27, 2020 · 3 comments · Fixed by #37
Closed

Add support to 'listen' for tags #36

dunkmann00 opened this issue Jul 27, 2020 · 3 comments · Fixed by #37
Labels
enhancement New feature or request

Comments

@dunkmann00
Copy link
Contributor

I found that when using the library as it is, it is not possible to avoid a slight delay while trying to read tags, due to read_passive_target needing to have a timeout. This is problematic if you are also trying to simultaneously perform another task, like updating neopixels. This delay prevents the neopixels from looking as smooth as they otherwise could.

I worked on tweaking the library slightly to allow, if needed, the ability to separate sending the listen command to the PN532, from reading a tag. None of the other functions are affected and the read_passive_target function is also still available and would still be the 'normal' way to read a tag. This additional functionality could be an option if you wanted a way to listen for a tag, while also avoiding any delay.

The idea would be:

  1. Start listening
  2. Check if a tag is present (by checking IRQ for instance)
  3. If no tag is found, perform other tasks
  4. Repeat 2 & 3 until a tag is found
  5. Read the UID of the tag

It would be similar to how it is currently done, but since checking IRQ is quite quick, you avoid any delay. This would allow other tasks to be run, basically uninterrupted while you wait for a tag.

Any questions or suggestions are welcome! Let me know what you think!

@evaherrada evaherrada added the enhancement New feature or request label Aug 6, 2020
@evaherrada evaherrada linked a pull request Aug 6, 2020 that will close this issue
@dunkmann00
Copy link
Contributor Author

@ladyada Have you had a chance to take a look at this?

@ladyada
Copy link
Member

ladyada commented Aug 17, 2020

nope been super super busy!

@dunkmann00
Copy link
Contributor Author

Okay, no worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants