hc12 and button input

@sterretje

I think your receiver code still suffers from the same problem. If the correct serial data is received, you will set Spark and Solenoid LOW. Next you check the button which is not pressed and you set both HIGH again.

I have not brought much change (except atoi()) in the receiver codes of OP. I tried to correct his problem so that the receiver could be operated independently using K1 or K2 as he has wanted in his original post. I have also not understood why the OP wants like this: the Solenoid and Spark will remain activated as long as either K1 and K2 remains closed; they will be immediately de-activated when the button is released.

Your opinion in Post#5 is the correct guidance for clean/modular codes. I will try to re-write the whole program in the light of your Post#5.