How to configure the LED
The LED on the Famoco devices can be used for notification purposes by varying the duration and color.
The colour
The color can be modified by changing the value of the notif.ledARGB
variable.
The prefix, 0x, never changes, it indicates that the following values are hexadecimal numbers. The following 6 digits correspond to RGB values and the last 2 correspond to the overall transparency.
Here is an example for a simple red color:
prefix | R | G | B | Transparency |
---|---|---|---|---|
0x | ff | 00 | 00 | 00 |
The duration
The duration of the led can be controlled by changing the notif.ledOnMS
which controls the "on time" and the notif.ledOffMS
which controls the "off time"
Here is a sample code using cyan as the color, an "on time" off 200ms, and an "off time" of 100ms:
Code Snippet
private void cyanLed() { NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification notif = new Notification(); notif.ledARGB = 0x00FFFF00; // Cyan LED notif.flags = Notification.FLAG_SHOW_LIGHTS; notif.ledOnMS = 200; // Duration of "on time" in ms notif.ledOffMS = 100; // Duration of "off time" in ms nm.notify(LED_NOTIFICATION_ID, notif); }
Note: This function is not available when the device is charging.