Hey all i am going to try and simplify what I am sure is a complicated question in which there are most likely numerous answers. I am building a wireless firework controller. The plan is to use 2 arduinos connected via hc12 modules. When a button is pressed at the transmitter it will send a pre programmed message to the receiver. I have the receiver set up that when it receives the message it will turn 1 of 6 pins(that will control a relay) high depending on which message is received. I plan on the button press being set up as a hardware interrupt. This is because when no buttons are pressed I want the transmitter to be continuely reading the state of several other pins hooked up to the receiver and reporting back there state. I envison it working like this;
transmitter sends message 1 to receiver
receiver receives message 1 and checks state of pin 1.
If Pin 1 is high, response message is sent back to the transmitter
transmitter receives response and turns LED 1 on
transmitter sends message 2 to receiver
receiver receives message 2 and checks state of pin 1.
If Pin 1 is high, response message is sent back to the transmitter
transmitter receives response and turns LED 2 on
and so on through the remaining pins
I was going to stager each message by using the millis timer so the transmitter would have time to receive a response and react.
My question is am i on the right track with this method of reading the receiver pins or is there a better way to do it? If its not could someone please provide a better way. i dont necessarily need specific code, just a-point in the right direction. Thanks!