Caravan panel that controls the relay. Need help with the basic code

Hey! :slight_smile: Sorry for my bad English :slight_smile:

I plan to make a panel with switches and light emitting diodes. Which is connected on an arduino nano. Then I have to connect the relay on the arduino mega. And use TX / RX to remote it. But where do I start? Anyone have simple code that shows how I can control a relay by and tilt the switch on the arudino nano?

That is to say:

Arduino nano: on / off switch (diode light for on / off status)
TX / RX connect (So I drop so many wires from the panel to the relay)
Arduino mega: Turns on relay on / off

Welcome back! We need a bit more information, it is possible to post a diagram of how the system goes together. Then a schematic, not a frizzy thing would be a big help with links to the technical information on the hardware devices.

Based on the limited information you supplied just connect the relay to the switch and forgot the Arduino boards.