Ah ok, thanks @Sasquatch
j54n1n
@j54n1n
Best posts made by j54n1n
Latest posts made by j54n1n
-
RE: NodeManager sensors with multiple interrupt pins
So can somebody confirm that pin change interrupts can wake up a sleeping node loaded with a NodeManager template sketch?
I have got the impression by reading here in the forum that the ATmega328p microcontroller has problems waking up from pin change interrupts. Maybe I am wrong?
-
RE: NodeManager sensors with multiple interrupt pins
Hello @NeverDie,
Yes that is it what I want to try. Both the rain sensor and the wind sensor are reed switches and it is clear to me that I could miss a pulse since it could be masked by one of the sensors. I am trying to fiddle arround in the code of the NodeManager template without changing to much of its interrupt (INT0 & INT1) handling. And since on my Moteino board INT0 is already occupied by the RFM69 radio I have to work arround pin D3 (INT1).Or is it possible also to use pin change interrupts with the NodeManager sketch on batteries? A.k.a.: Can I use PCINT2_vect for port D pins (for ex.: PD4 on pin D4) that wakes up my sleeping NodeManager sketch?
Cheers
-
RE: NodeManager sensors with multiple interrupt pins
Hello,
https://forum.mysensors.org/topic/8936/6-8-buttons-battery-remote-node/6: These are valid and nice hardware solutions for multiple interrupts. Since I am building my node as a replacement for an old weather station I have allocated already all the analog pins of the Moteino for the other sensors. So for that reason I have still some free digital pins and I will go for the wired or solution with the diodes.I was more interested in a solution on the software side. For example if the team of the NodeManager library had thought of supporting more than one pulse type sensor per interrupt pin. In my case it would be the rain sensor and the wind speed sensor.
I hope it is now more clear what I meant.
Cheers -
NodeManager sensors with multiple interrupt pins
Re: NodeManager
Hello,
I would like to use more than one sensor from within the NodeManager v1.8 template sketch where each of the sensors has its own interrupt pin.In my particular case I would like to support in my node sketch both a tipping bucket rain sensor and a wind speed sensor. Both use a reed switch with a pullup resistor to VCC and the switches short the sense lead to GND when activated.
Furthermore I am using a Moteino with RFM69HW radio. Therefore the INT0 on pin D2 is already in use and I am left only with the INT1 on pin D3. As I have read already on this forum, in this case I could apply the wired or configuration from http://www.gammon.com.au/forum/?id=11091 such that when the interrupt pin gets triggered I can read from another digital pin which sensor was the source of the interrupt.
I have read a little bit the source code from the NodeManager and the MySensors library and if I have it understood correctly when I derive my code from SensorPulseMeter for multiple sensor classes only the last instance of a class placed in the main sketch will "win" the onInterrupt() callback. It seems there is a one to one relation between interrupt pin and SensorPulseMeter subclass instance.
I imagine that to support the wired or configuration one could code "by hand" a sequence of attachInterrupt() with a if-else condition from within the main sketch file and redirect the signal source to a handler function for each sensor. But would it not be nicer to have some elegant way to code a new subclass of SensorPulseMeter that can accept the one available interrupt pin and keep a list of sense pins and/or interrupt handlers for each derived sensor instance?
Are there any suggestions how I could approach this?
Cheers and happy new year 2020 ^^