1 // ------------------------------------------------
2 // Controlling LifxLightBulb through Particle Cloud
3 // @author Rahmadi Trimananda - UC Irvine
4 // ------------------------------------------------
6 #include "LifxLightBulb.h"
17 macAddress1[0] = 0xD0;
18 macAddress1[1] = 0x73;
19 macAddress1[2] = 0xD5;
20 macAddress1[3] = 0x12;
21 macAddress1[4] = 0x8E;
22 macAddress1[5] = 0x30;
23 macAddress1[6] = 0x00;
24 macAddress1[7] = 0x00;
25 IPAddress devIPAddress1(192, 168, 1, 126);
27 llb1 = new LifxLightBulb(devIPAddress1, macAddress1, 12345);
32 macAddress2[0] = 0xD0;
33 macAddress2[1] = 0x73;
34 macAddress2[2] = 0xD5;
35 macAddress2[3] = 0x02;
36 macAddress2[4] = 0x41;
37 macAddress2[5] = 0xDA;
38 macAddress2[6] = 0x00;
39 macAddress2[7] = 0x00;
40 IPAddress devIPAddress2(192, 168, 1, 232);
42 llb2 = new LifxLightBulb(devIPAddress2, macAddress2, 12346);
45 pinMode(led1, OUTPUT);
46 // Argument needed ("on" or "off") for these functions
47 //Particle.function("lifx1",lifxb1Toggle);
48 //Particle.function("lifx2",lifxb2Toggle);
50 // Argument not needed for these functions
51 Particle.function("turnOn_1",turnOnLiFX_1);
52 Particle.function("turnOff_1",turnOffLiFX_1);
53 Particle.function("turnOn_2",turnOnLiFX_2);
54 Particle.function("turnOff_2",turnOffLiFX_2);
63 // Toggling Lifx light bulb 1
64 int lifx1Toggle(String command) {
70 else if (command=="off") {
79 // Toggling Lifx light bulb 2
80 int lifx2Toggle(String command) {
86 else if (command=="off") {
96 int turnOnLiFX_1(String command) {
103 int turnOffLiFX_1(String command) {
110 int turnOnLiFX_2(String command) {
117 int turnOffLiFX_2(String command) {