OK guys, it seems this is getting pretty complex (at least for me) :-?.
Let me explain a bit what I'm trying to do:
I need to count pulses from 3 sensors:
- Counter1: idle = low, pulse = high, max 1 pulse every +/- 10 secs, and every hour this pulse stays high for about 60 secs
- Counter2: idle = low, pulse = high, max 3 pulses in 1 sec
- Counter3: idle = high, pulse = low, max 2 pulses in 1 sec, pulse can stay low for several hours
In my current setup I just count the pulses in the loop(), push the counter values over serial to my PC every 30 secs and reset them to 0, but people told me that i will miss pulses this way. So I'm looking for a more robust/safer way to count the pulses.
Seen that there are only 2 attachInterrupts, I was looking to or add a 3th interrupt, or don't use attachInterrupt and create the 3 interrupts manually.
I'm getting great help and feedback from this wonderful community but as mentioned at the beginning of this post, it seems to become complex. Now I'm asking myself: Is this complexity needed for what I'm trying to accomplish?
In the near future, I will be replacing the serial/usb connection to my pc with a wireless connection (RFM12B).
I also have 1-Wire devices connected to this arduino, but if you guys suggest me that it would make more sense to move this to another arduino, i will do so.
Thats about what i have at the moment, but lets focus for the moment on the counter part as that is the most important one for me.
Thanks in advance,