Simple script to automate the house with Arduino and a smartphone.
The project is been made with C++, using Arduino AT Mega 2650 board, ethernet shield W5100 and 8 channel relay module, TouchOSC apk for Android, but is also available on IoS, TouchOSC Editor for Windows, Mac or Linux, to create the template with the commands and TouchOSC bridge
I use the Arduino IDE 1.8.1 to compile this code in arduino board, verification will display some warnings, in my case did, but this will not prevent the code to work. You will need to design your own display with the right commands in TouchOSC Editor to trigger the arduino ports, i highly recommend to use external power supply to the relay module, otherwise can present malfunctioning such as high delay or even't work at all.
The button on the MIDI OSC should be configured as "/ard/relePin2", for example, the port configured in the OSC should be 9000.