Software
Following the book "IoT in five days" and the example in the GitHub, this demo implements the use of variable command from ubidots and read a digital light sensor.
A 6LoWPAN/IPv4 router was used to translate the 6LoWPAN/IPv6 data from the wireless network to a remote MQTT broker on the "cloud" in this case Ubidots, the application creates a tree type of events:
- a data event (sensor readings published periodically)
- alarm event (sensor readings over/below a given threshold)
- data from Ubidots (the device reads the value published by the platform)
How it works
Control a variable from the mqtt, the variable is loaded in arg, in the activate_color_led function it generates a PWM for each color of the RGB LED, the variable arg is multiplied by a factor, the result is loaded in count, in case of the red color, the factor is less than the rest since the red color has more intensity, because works at difrent voltage. datasheet of LED ASMB-MTB0-0A3A2
The device polling the sensors and publishig every interrupt of etimer, in the funtion of poll_sensors if detected and god configured read the TSL2563 in the channel 0 detects visible and IR radiation (channel 1 only IR radiation), works over I2C.

CODE
lighting
It is inside of branch Zolertia-paks. This file is linked and selected in the mikefile, don't flashing lighting flash makefile