Amazon Alexa Controlled LED Strip Lights

void trans(const char *event, const char *data){ String responsevalue = String(1); Particle.publish("response", responsevalue, PRIVATE); delay(2000); if (strcmp(data, "lights_off")==0) { analogWrite(A0, 255); //blue analogWrite(A1, 255); //green analogWrite(A2, 255); //red } else if (strcmp(data, "blue")==0) { analogWrite(A0, 0); analogWrite(A1, 255); analogWrite(A2, 255); } else if (strcmp(data, "green")==0) { analogWrite(A0, 255); analogWrite(A1, 0); analogWrite(A2, 255); } else if…

Amazon Alexa Controlled LED Strip Lights 1
void trans(const char *occasion, const char *knowledge){ String responsevalue = String(1); Particle.publish(“response”, responsevalue, PRIVATE); delay(2000); if (strcmp(knowledge, “lights_off”)==0) { analogWrite(A0, 255); //blue analogWrite(A1, 255); //inexperienced analogWrite(A2, 255); //crimson } else if (strcmp(knowledge, “blue”)==0) { analogWrite(A0, 0); analogWrite(A1, 255); analogWrite(A2, 255); } else if (strcmp(knowledge, “inexperienced”)==0) { analogWrite(A0, 255); analogWrite(A1, 0); analogWrite(A2, 255); } else if (strcmp(knowledge, “crimson”)==0) { analogWrite(A0, 255); analogWrite(A1, 255); analogWrite(A2, 0); } else if (strcmp(knowledge, “orange”)==0) { analogWrite(A0, 255); analogWrite(A1, 127); analogWrite(A2, 0); } else if (strcmp(knowledge, “yellow”)==0) { analogWrite(A0, 255); analogWrite(A1, 0); analogWrite(A2, 0); } else if (strcmp(knowledge, “purple”)==0) { analogWrite(A0, 0); analogWrite(A1, 255); analogWrite(A2, 0); } else if (strcmp(knowledge, “pink”)==0) { analogWrite(A0, 127); analogWrite(A1, 255); analogWrite(A2, 0); } //arduous code blinking yellow and inexperienced each 2 seconds //analogWrite(A0,255); // yellow //analogWrite(A1,0); //analogWrite(A2,0); //delay(2000); //analogWrite(A0,255); // inexperienced //analogWrite(A1,0); //analogWrite(A2,255); //delay(2000); else if (strcmp(knowledge, “party_lights”)==0 || strcmp(knowledge, “party_lights”) !=0) { analogWrite(A0, 0); // blue analogWrite(A1, 255); analogWrite(A2, 255); analogWrite(A0, 255); //off analogWrite(A1, 255); analogWrite(A2, 255); delay(1500); analogWrite(A0, 255); // inexperienced analogWrite(A1, 0); analogWrite(A2, 255); analogWrite(A0, 255); analogWrite(A1, 255); //off analogWrite(A2, 255); delay(1500); analogWrite(A0, 255); analogWrite(A1, 255); //crimson analogWrite(A2, 0); analogWrite(A0, 255); analogWrite(A1, 255); // off analogWrite(A2, 255); delay(1500); analogWrite(A0, 0); analogWrite(A1, 255); // aqua analogWrite(A2, 127); analogWrite(A0, 255); analogWrite(A1, 255); // off analogWrite(A2, 255); delay(1500); analogWrite(A0, 0); analogWrite(A1, 255); // purple analogWrite(A2, 0); analogWrite(A0, 255); // off analogWrite(A1, 255); analogWrite(A2, 255); delay(1500); analogWrite(A0, 255); //orange analogWrite(A1, 127); analogWrite(A2, 0); analogWrite(A0, 255); // off analogWrite(A1, 255); analogWrite(A2, 255); delay(1500); analogWrite(A0, 255); analogWrite(A1, 0); // yellow analogWrite(A2, 0); analogWrite(A0, 255); analogWrite(A1, 255); // off analogWrite(A2, 255); delay(1500); analogWrite(A0, 0); analogWrite(A1, 255); // mild blue analogWrite(A2, 127); analogWrite(A0, 255); analogWrite(A1, 255); // off analogWrite(A2, 255); delay(1500); analogWrite(A0, 0); analogWrite(A1, 0); // white analogWrite(A2, 0); analogWrite(A0, 255); analogWrite(A1, 255); // off analogWrite(A2, 255); } else {} delay(1000); } void setup() { pinMode(A0, OUTPUT); //blue pinMode(A1, OUTPUT); //inexperienced pinMode(A2, OUTPUT); //crimson }

Source

Subscribe our newsletter

Subscribe now and get 25% OFF of all our storewide products

Lorem ipsum dolor sit amet, consectetur adipiscing elit purus luctuc eget
Powertrical new logo

Best guides to perfect electrical accessories and supplies for authentic suppliers