I have a Xenon from the first Kickstarter offering. Got it configured earlier today, but now the status LED is flashing green fast. Not the slow green flash shown on the troubleshooting document. What does this mean?
Working on this demo project:
Sample project
Code:
// Subscribe to sensor tripping using the node (Xenon) board.
int led_pin = A0;
// We start with the setup function.
void setup() {
// This part is mostly the same:
pinMode(led_pin,OUTPUT);
// Here we are going to subscribe to your buddy's event using Particle.subscribe
Particle.subscribe("tripStatus", myHandler); // the name of the publish() call in sensor node [ publish("tripStatus") ]
}
void loop() {
}
// Now for the myHandler function, which is called when the cloud tells us that our sensor's event has been published.
void myHandler(const char *event, const char *data)
{
if (strcmp(data,"breach")==0) {
// if the sensor's threshold is breached, then turn your LED on
digitalWrite(led_pin,HIGH);
}
else if (strcmp(data,"all_clear")==0) {
// if your sensor's beam is all clear, turn your board LED off
digitalWrite(led_pin,LOW);
}
}