Arduino to Arduino message sending

To send messages between two Arduinos (i.e. turn on LED on pin 12, turn off the motor on pin11.. so on), you can connect TX pin to RX, RX to TX and send Serial messages to each other. But if you want to send more than one numbers (like pin number and pin state), it is a bit tricky, as you can not indicate the index of the message.

There are many ways to solve this problem, but one of the easy way is to use Packetizer library.
https://github.com/i-n-g-o/Packetizer

Download the whole package (from “download zip” button on the right bottom) and place it on your Document/ Arduino/ Libraries folder. Reopen the Arduino IDE and you will find examples on Files/ Examples/ Packetizer

Simple_proto_send_recieve sketch shows you how to send on/off status
Simple_proto_send_recieve2 sketch shows you how to send values (in this case analogWrite value)