LED patterns
codemonkey (Talk | contribs) m |
codemonkey (Talk | contribs) |
||
Line 126: | Line 126: | ||
Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function. | Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function. | ||
+ | === Default LED Patterns for Nokia N900 === | ||
+ | The default LED patterns for the n900 are: | ||
+ | |||
+ | <tt> | ||
+ | :PatternError=0;5;0;r;9d8040007f007f0040ff7f007f000000;9d800000 | ||
+ | :PatternDeviceOn=254;0;0;rgb;9d804000422043207f100000;9d800000 | ||
+ | :PatternDeviceSoftOff=253;0;0;rg;9d804000423f433f7f100000;9d800000 | ||
+ | :PatternPowerOn=9;3;0;rgb;9d80400042ff02ffc000;9d800000 | ||
+ | :PatternPowerOff=10;3;0;rgb;9d80400001ff43ff7f007f00c000;9d800000 | ||
+ | :PatternCommunicationCall=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationSMS=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationEmail=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommonNotification=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternWebcamActive=20;1;0;r;9d80400004ffc0000000;9d800000 | ||
+ | :PatternBatteryCharging=50;4;0;rg;9d804000427f0d7f7f007f0042000000;9d800000 | ||
+ | :PatternBatteryFull=40;4;0;g;9d80407f0000;9d800000</tt> | ||
{{Reflist}} | {{Reflist}} | ||
[[Category:N900 Hardware]] | [[Category:N900 Hardware]] |
Revision as of 17:24, 10 January 2010
Contents
|
N800
The N800 has a single-colour (blue) LED behind the dpad.
N810
The N810 has an RGB LED.
N900
The patterns in the /etc/mce/mce.ini are broken down as follows:
- PatternName=Priority;ScreenOn;Timeout;LEDsToMap;Engine1Pattern;Engine2Pattern
Pattern Format
Priority
0-255, 0 is highest, 255 is lowest.
Since currently only a single pattern at a time can be displayed, this is used to assign importance to the LED patterns. Although only a single LED pattern can be displayed at any time, multiple patterns may be active, the pattern with the highest priority being displayed.
A common example of this is where the n900 is on charge, the battery is full (starting PatternBatteryFull with a priority of 40), and an SMS message is received (PatternCommunicationSMS with a priority of 30). On receipt of the SMS, the LED begins to display the flashing blue led of an SMS. Once that SMS has been dismissed, the green LED of the full battery notification is again displayed.
ScreenOn
- 0: only show pattern when the display is off
- 1: show pattern even when the display is on
- 2: only show pattern when the display is off, including acting dead
- 3: show pattern even when the display is on, including acting dead
- 4: only show pattern if the display is off, or if in acting dead
- 5: always show pattern, even if LED disabled
TimeOut
This is the time-out of the LED pattern in seconds. 0 for infinite, i.e. until the notification is dismissed.
If this is set to 20, the pattern will display for 20 seconds, and then stop.
LEDsToMap
There are two engines that can be used to make custom LED patterns.[1]
r, g, or b maps the corresponding LED to Engine 1.
R, G, or B maps the corresponding LED to Engine 2.
For example, "rG" maps the red LED to Engine 1, and the green LED to Engine 2.
You should avoid mapping the same LED to both engines.
Engine Pattern
This is a series of text that describes the speed and intensity of changes in the LED(s) beign managed by that particular engine. See below for a breakdown of the patterns. Each can be at most 16 commands long.
Lysti Format Engine Patterns and Commands
The LED patterns are of the form
- 9d8040007f007f0040ff7f007f000000
Breaking this down for ease of reading we get a list of 8 commands, each of which is four characters long.
- 9d80 4000 7f00 7f00 40ff 7f00 7f00 0000
9d80 - Refresh Engine Multiplexor
This is to be used as the first command of every pattern). If this is excluded from the pattern, the led won't flash.
40xx - Set channel brightness
Where xx are two hexadecimal digits, e.g. 00 (for a brightness of 0) or ff (for a brightness of 255).
xxyy - Adjust channel brightness
Increment or decrement the channel brightness over a period of time (xx) and a number of steps (yy).
Where xx and yy are hexadecimal digits
xx - Time (per step?)
yy - Number of steps
The following rules apply to these:
- If xx is even, the steps are increment steps and brightness will increase.
- If xx is odd, the steps are decrement steps and brightness will decrease.
- If xx is between 02 and 3f, a short step time is used (granularity 0.49ms)
- If xx is between 42 and 7f, a long step time is used (granularity 15.6ms)
- yy can be any value between 00 and ff (0 to 255)
- Pauses can be achieved by using 00 steps, e.g. 7f00 where, where the 7f is how long each step takes and 00 is how many increment steps to take.
The mce.ini instructions (/etc/mce/mce.ini) also state that
- Two consecutive increment/decrement sequences are needed to cover the entire range from 0-255
However I believe this is a throwback to the older patterns, and the full range of 00 to ff is available in a single step for the number of steps, since whether these are increment or decrement steps are now handled through use of even or odd xx values.
0000 - Jump to start
Jump to the start of the pattern for this channel. You will see this at the end of most repeating patterns.
This command may not actually be needed to make the pattern repeat. If this is removed, the pattern will repeat anyway, although it's useful to have it there as an explicit command to repeat for clarity. If you wanted a pattern to run once and then terminate you would use the c000 command.
c000 - End pattern execution
The pattern is terminated without repeating. It is important to note here that although that pattern has stopped, it is still active until the Timeout time has passed. As a consequence of this any higher priority patterns (patterns with a lower priority value, since 0 is the highest and 255 is the lowest) will not be displayed until the pattern has fully expired. In the case that the timeout is 0, it will not display until the notification is dismissed.
Sending and receiving engine triggers
Further complexity in patterns can be added through use of triggers. This is especially useful if we want to synchronise the two engines in time, for example to wait until the LED has turned red before turning it immediately to green. Rather than waste time with steps doing nothing, we can simply wait for a trigger to be received from the other engine.
The following pattern does exactly that:
- PatternTest=29;1;0;rG;9d80400008ffe0044000c000;9d80e08040ffc000
e002, e004, e008 - Send engine trigger
e002 - Send trigger to engine 1 e004 - Send trigger to engine 2 e008 - Send trigger to engine 3 (used by keyboard backlight)
A signal is sent from the current engine to signal another engine.
Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function.
e080, e100, e200 - Wait for engine trigger
e080 - Wait for trigger from engine 1 e100 - Wait for trigger from engine 2 e200 - Wait for trigger from engine 3 (used by keyboard backlight)
Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function.
Default LED Patterns for Nokia N900
The default LED patterns for the n900 are:
- PatternError=0;5;0;r;9d8040007f007f0040ff7f007f000000;9d800000
- PatternDeviceOn=254;0;0;rgb;9d804000422043207f100000;9d800000
- PatternDeviceSoftOff=253;0;0;rg;9d804000423f433f7f100000;9d800000
- PatternPowerOn=9;3;0;rgb;9d80400042ff02ffc000;9d800000
- PatternPowerOff=10;3;0;rgb;9d80400001ff43ff7f007f00c000;9d800000
- PatternCommunicationCall=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
- PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
- PatternCommunicationSMS=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
- PatternCommunicationEmail=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
- PatternCommonNotification=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000
- PatternWebcamActive=20;1;0;r;9d80400004ffc0000000;9d800000
- PatternBatteryCharging=50;4;0;rg;9d804000427f0d7f7f007f0042000000;9d800000
- PatternBatteryFull=40;4;0;g;9d80407f0000;9d800000
Cite error:
<ref>
tags exist, but no <references/>
tag was found