I am using an interrupt in my code to count the pulses from a flow meter. I am converting to a usable flow rate and then sending the information over The Things Network (TTN) using a LM-110H (LoRaWAN). When i comment out the interrupt i am able to send and see example data on TTN. When the interrupt is being used to calculate my pulse count my serial prints everything fine but when i plug in my LM-110H transmitter no data is received on the TTN.
My question: Can i use an interrupt and send data wirelessly? How is the interupt affecting my wireless signal out?
I am using an interrupt in my code to count the pulses from a flow meter. I am converting to a usable flow rate and then sending the information over The Things Network (TTN) using a LM-110H (LoRaWAN). When i comment out the interrupt i am able to send and see example data on TTN. When the interrupt is being used to calculate my pulse count my serial prints everything fine but when i plug in my LM-110H transmitter no data is received on the TTN.
My question: Can i use an interrupt and send data wirelessly? How is the interupt affecting my wireless signal out?
I know what my problem is now.
i start the interrupt() and hold it for one second this is how i am determining how many pulse per second there are.
then i use noInterrupts()....well this just shut off all my interrupts even the ones sending out bytes to the serial hardware....
Is there a way to just stop the interrupt on Pin 2 and allow other auto background interrupts to still do their thing?
The reason i wont upload all the code is that it contains private information including gateway keys and EUIs....i was hoping someone might have a quick solution to turn on and off interrupts per pin instead stopping all intterupts
Why not just disable the interrupt you're using?
Depending on what interrupt you're triggering on that pin, it could be either in one of the PCMSK registers (for PCINT), EIMSK (for INTn), TIMSK1 (if using input capture), and so on - that's assuming it's a 328p-based board, other microcontrollers will give different names for them.
Dribbling out (or not) information about your problem is a waste of time, not least yours, when you have to wait five minutes between posts.
You could have told us in your first post which processor you're using, what type of interrupt, what your code looked like (passwords etc are very easily masked/redacted).
Why start and stop interrupts at all. Let the interrupt continue all the time but just zero the count, wait a second and then read the count. You have the information you need now and it does not matter if the interrupt count continues or even overflows and wraps around because the next time you ready to take a reading the count is zeroed.