Communication Protocol
The communication between the microcontroller and the Android app will be a simple text-based protocol via the serial Bluetooth connection.
Requirements
- Set brightness & color from the app
- Set date, time and geocoordinates from the app
- Send current color & brightness values back to the app (on request from the app)
- Some sort of handshake or ping so the app can check if the lamp is connected and ready to accept commands
Commands
Set Brightness
sb:<value[0;100]>
Set Color
sc:<value[0;100]>
Set time
st:<unix_timestamp>
Set location
sl:<lat>,<lon>
Get Values
Just replace the first character (s) of the correspnding set command with “g” and omit the colon and arguments. The value returned will correspond to the format of the respective set command.
Notes
Nice read on timers and interrupts: http://www.robotshop.com/letsmakerobots/arduino-101-timers-and-interrupts