Skip to content
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

Multiple receivers #109

Open
soulsbysynths opened this issue Aug 18, 2021 · 0 comments
Open

Multiple receivers #109

soulsbysynths opened this issue Aug 18, 2021 · 0 comments

Comments

@soulsbysynths
Copy link

I have a circuit that has 2 receivers with the idea that there's twice the chance of getting a correctly received message (the distance is 15+ metres, so chance of error is high).
The circuit uses an Atmega328P with Uno bootloader running at 8Mhz using the internal clock and the receivers are on pins 2 & 3, so I should be able to use interrupts on both pins.
I soon realised that this wouldn't be trivial because most of the work is handled by the recvGlobal struct. I then changed this to an array recvGlobal[2]. Receiver and decoder class constructors were changed to take an index_ variable. recvGlobal was changed to recvGlobal[index_] in the classes. I could then create 2 receiver and 2 decoder objects in my Arduino sketch.
This all compiled and worked successfully. However..... I found that the results were significantly worse than using just 1 receiver.
I have 2 theories about what could be happening:

  1. Having 2 blocking interrupts triggering at the same time is causing timing inaccuracies in reading the incoming signal. This might be made worse by only running at 8Mhz using the flakey internal clock.
  2. There's an error in my code or I've failed to understand part of your library!

I was wondering if anyone has successfully used 2 receivers with this library and has any tips for debugging my issues. Happy to upload any of my modified code.
thanks, Paul

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

No branches or pull requests

1 participant