My Internet Button (IB) won’t flash anymore.
The white plastic case is loose.
When I power it up, the middle LED blinks blue.
If I jiggle it, some of the LED’s around the edge turn on.
If I keep jiggling, eventually they all turn on, but different colors.
MY 2ND IB:
All works ok with my 2nd IB.
Its white plastic case is tight.
MY 1ST IB:
It worked ok at first.
Paired ok, and ran examples ok.
I then modified example to turn on 3 different LED’s for each of the 4 buttons.
Worked great.
I was pushing all the buttons simultaneously and all LED’s turn on.
While I was showing off to friend, some of the LED’s began to stick on.
Is it possible my code destroyed Photon or IB hardware?
HERE IS CODE…
/* LED and button test.
Turns on LED's when buttons pressed.
2016-08-10a
*/
// This #include statement was automatically added by the Particle IDE.
#include "InternetButton/InternetButton.h"
#include "InternetButton/InternetButton.h"
/* How about we make this interactive? */
InternetButton b = InternetButton();
void setup() {
// Tell b to get everything ready to go
// Use b.begin(1); if you have the original SparkButton, which does not have a buzzer or a plastic enclosure
// to use, just add a '1' between the parentheses in the code below.
b.begin();
}
void loop(){
// When you click the second button (at the 3 o'clock position) let's turn that LED on
if(b.buttonOn(1)){
b.ledOn(1, 255, 0, 0);
b.ledOn(11, 255, 0, 0);
}
// And if the button's not on, then the LED should be off
else {
b.ledOff(1);
b.ledOff(11);
}
if(b.buttonOn( 2 )){
b.ledOn(2, 0, 255, 0);
b.ledOn(3, 0, 255, 0);
b.ledOn(4, 0, 255, 0);
}
// And if the button's not on, then the LED should be off
else {
b.ledOff(2);
b.ledOff(3);
b.ledOff(4);
}
if(b.buttonOn(3)){
b.ledOn(5, 0, 0, 255);
b.ledOn(6, 0, 0, 255);
b.ledOn(7, 0, 0, 255);
}
// And if the button's not on, then the LED should be off
else {
b.ledOff(5);
b.ledOff(6);
b.ledOff(7);
}
if(b.buttonOn( 4 )){
b.ledOn(8, 255, 255, 0);
b.ledOn(9, 255, 255, 0);
b.ledOn(10, 255, 255, 0);
}
// And if the button's not on, then the LED should be off
else {
b.ledOff(8);
b.ledOff(9);
b.ledOff(10);
}
/* Much like the LEDs, there are also functions to check if all the buttons are on- b.allButtonsOn()
or if all the buttons are off- b.allButtonsOff() */
}