WebBluetoothCG / demos

Demo applications showing off Web Bluetooth
https://webbluetoothcg.github.io/demos/
Apache License 2.0
624 stars 188 forks source link

Add ability to control intensity #62

Closed g-ortuno closed 7 years ago

g-ortuno commented 7 years ago

I have a candle that I use for testing. Because it's usually on the battery runs out very fast. Could we add the ability to control the intensity so that the battery lasts longer?

@beaufortfrancois

beaufortfrancois commented 7 years ago

I thought it would be as simple as

let [saturation, red, green, blue] = [0xff, 0x00, 0xff, 0x00];
colorCharacteristic.writeValue(Uint8Array.of(saturation, red, green, blue));

but it isn't ;(

Do you have some thoughts on how we could map rgb values to control intensity?

g-ortuno commented 7 years ago

Does changing the saturation affect the intensity?

beaufortfrancois commented 7 years ago

It doesn't from what I've been testing sadly ;(


// These look the same...
colorCharacteristic.writeValue(Uint8Array.of(0xff, 0x00, 0xff, 0x00));
colorCharacteristic.writeValue(Uint8Array.of(0x00, 0x00, 0xff, 0x00));
g-ortuno commented 7 years ago

:disappointed: