i need your support.
My plan is to control differend LEDs (on/off) which are connected to different PWM-Pin on the Master-Arduino by switches connected to slave arduinos. - So its a kind of change circuit w/ buttons which are connected to different Arduinos to avoid complex wiring.
The Arduinos are communicating via I2C.
If e.g. the floor-LED-Button on one slave arduino is pressed, the correct Pin on the Master Arduino is changing its state (On / Off).
I'm wondering how to setup the control in a smart way. I thought about to send a char which identifies the correct LED. A general function is using this char as input and changes the state of the PIN. Like this example (based on a single Arduino setup:
Do some research about how I2C works, what it offers. As I got it the master will need to call each slave for a slave message. What data types to use, You look for that.
Searching for electrical data will be useful as the total number of devices might call for suitable pullup resistors on SDA and SCL.
Why not post a concept block drawing showing wiring lengths, links to technical info on hardware items you have chosen. This has a big impact on what I would recommend to use. The information you pass to control things is up to you. Using a character is a good way to start, you can see that on the monitor. You learn the concept that way and later expand upon it. There many standards which make it easier but they do not need to be followed.
Thanks for your feedback & sry for the unclear description.
@Railroader : Yes, im currently reading in parallel how the I2C bus works. I just wanted to get a direction from an expert how to realize such a system. thx. @gilshultz@lastchancename : Below a diagram with some additional information.
I have 4 different buttons (not switches) per arduino. I have at least 2 Arduino to control the lamps.
In addition I would like to alluminate all 4 buttons independently.
The buttons are located direct next to the arduino.
If I wire all buttons to 1 Arduino I would need to connect 2 cables per switch (Button Signal & the 5V for illuminating). This would be in general possible but the SW solution is definitely the smarter way. Especially when I would like to extend the system in future.