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();
    //example for cyan
    notif.ledARGB = 0x00FFFF00;
    notif.flags = Notification.FLAG_SHOW_LIGHTS;
    //Duration of "on time"
    notif.ledOnMS = 200; 
    //Duration of "off time"
    notif.ledOffMS = 100; 
    nm.notify(LED_NOTIFICATION_ID, notif);

Note: This function is not available when the device is charging.