Hello,
I have a project going on that requires 2 arduinos.
Basicly 1st arduino will ajdust 1 digital potentiometer, 1 relay and I have some led movement going on with commands received from IR (remote).
2nd arduino will ajdust second digital potentiometer, 4 relays with commands received from bluetooth module.
I have rx and tx pins avalible plus 3 other digital pins.
1st arduino will be in diy soundbar ajdusting volume level and power on/off relay via ir remote.
2st arduino will be in diy subwoofer ajdusting subwoofer level, bass boost (3 relays) via bluetooth.
Now I would need those two arduinos to communicate with each other so I can ajdust everything via ir and bluetooth.
I would like to avoid I2C (Wire.H) because I will have digital pot on I2C on both arduinos (volume level on first arduino, subwoofer level on second).
I know that I could assign different IDs for both arduinos and digital potentiometers, but it would get too complex for me, I really don`t feel comfortable doint it that way.
I would need values to exchange between arduinos something like:
If relay on first arduino is HIGH send value "1 for example" to second arduino so second arduino knows it can turn relay for subwoofer on and it can send information via bluetooth to my android phone and make all buttons clickable.
If relay on first arduino is LOW send value "2 for example" to second arduino to make subwoofer relay off and send information via bluetooth...
If first arduino receives right code from IR remote to turn relay 2 on second arduino on send value "3 for example" to second arduino to turn relay 2 on second arduino on and that second arduino can send information via bluetooth...
Also I would need to send values that digital potentiometers are set to. Potentiometer have 200 steps for example,
so I would add 100 for example potVal + 100 to make space for lower values (relays) and potVal+300 to make space for first digital pot.
I was thinking that I could define integer on first arduino like:
long int receive;
long int send;
Then I would need other arduino to send command to change value of receive on first arduino.
So then I could use if statements for example:
if (receive == 2)
{
digitalWrite(subRelay, LOW);
}
Thank you