4

GCC has a handy function __builtin_return_address(depth) which should do what you want. To get the return address of the current function (which should be the same whether it's a normal function or an ISR on AVR) you set the depth to 0: void *addr = __builtin_return_address(0);


3

There are two things to tackle in your schematic. First is snubber networks. These are used to aid in the prevention (or rapid extinguishing) of sparks between the contacts of switching gear (like relays). You should attach one across the contacts of each relay. It is these sparks that create most of the "airborne" EMI. A diode across a relay's ...


2

Like timemage mentioned i had to qualify ch as volatile. so: volatile unsigned char CH[] = {CH1, CH2, CH3, CH4}; is the fix


1

Here is a general idea of a MOSFET alternative for switching the light on and off. Click to simulate in Falstad. You can click the switch and the H/L input to see how it operates while running the simulation. The p-channel MOSFET in series with Light 1 could be FQP27P06. The n-channel MOSFETs are of much lower power. Using MOSFETs eliminates both the RFI/EMI ...


1

First: It is not necessary to use interrupts for buttons, because when humans press buttons they will be at least actived for about 100ms, which is very slow for a microcontroller. You would just need to rewrite your code to be non-blocking (for example by ditching all delay() calls and instead use millis() like in the BlinkWithoutDelay example, that comes ...


1

From what you have indicated (being wired correctly) there is a high probability you have a bad connection. It could be one of many things such as a loose wire, broken wire, problem with the module, etc... Swp A & B and see what happens.


Only top voted, non community-wiki answers of a minimum length are eligible