You folks helped me a short time ago with a serial communications problem I was having and I am graciously happy. However I am back begging again because I am having another problem with the project concerning interrupts. The project has 3 Nano boards to generate specific timed pulses, read analog voltages, monitor multiple switches, control colored leds, display data on an LCD display, communicate with each other via serial and generate sounds. Guess what? I managed to achieve that and it is working fine. What I am having trouble with is the coding to install an interrupt on pin d2 connected to a button switch. My goal is to use the switch to power down all 3 Nanos to a low current value instead of using an on off switch to cut the battery voltage. A second push of the switch should start things up again where it left off. I realize I might have to make sure that the outputs might have to be put into a known state before they are disconnected, but the pins are not really providing much current. Total current draw is 79 ma for all 3 devices and 171 ma if I turn the backlight on and the LED’s are only on during a short calibration period. I have read multiple ways of implementing this code and tried to put together the most common parts into something that would accomplish this, but running into problems. Either the ISR is not activated or when change code and get to do that it stays there. I once got it go there, but it was doing it itself, returning then executing again. I owe it all to my inexperience, but once I get it, I will remember it for a long time. Each Nano has it’s own code, so I suspect I will have to connect all pin d2’s together and put the code in each of them to accomplish power down. Here is a skeleton sample of where I left off in the coding. There are over 300 lines of code in the main Nano so I did not include those, just the parts with the interrupts. I hope someone can help.
Thanks in advance
Forum_sketch.ino (1.15 KB)