LED closing when disconnected
public void connected() {
Log.i("ExampleActivity", "A Bluetooth LE connection has been established!");
ledCtrllr= (LED) mwCtrllr.getModuleController(Module.LED);
ledCtrllr.stop(true);
playCyan(ledCtrllr);
}
public void disconnected() {
Log.i("ExampleActivity", "Lost the Bluetooth LE connection!");
}
};
And playCyan is this one
private void playCyan(LED ledCtrllr) {
short pulseWidth= 2000;
ledCtrllr.setColorChannel(ColorChannel.BLUE).withHighIntensity((byte) 31)
.withHighTime(pulseWidth).withPulseDuration(pulseWidth)
.withRepeatCount((byte) -1).commit();
ledCtrllr.setColorChannel(ColorChannel.GREEN).withHighIntensity((byte) 31)
.withHighTime(pulseWidth).withPulseDuration(pulseWidth)
.withRepeatCount((byte) -1).commit();
ledCtrllr.play(false);
}
Comments
@Override
public void orientationChanged(Orientation accelOrientation) {
Log.i("ExampleActivity", String.format(Locale.US, "Orientation= %s",
accelOrientation));
playYellow( (LED) mwCtrllr.getModuleController(Module.LED));
});
switch(color){
case(0): playGreen(ledController); Log.i("Change",""+color); color++; break;
case(1): playYellow(ledController); Log.i("Change",""+color); color++; break;
case(2): playCyan(ledController); Log.i("Change",""+color); color++; break;
case(3): playMagenta(ledController); Log.i("Change",""+color); color=0; break;
}
}
Doesn't work too