A practical guide to the CFX accent LED pads, including which outputs are PWM or digital-only, how leds.txt works, how polarity behaves, and how to build accent patterns and battery indicators.
leds.txt is structured/extra/ACCENTS/style_accentsleds.txtAccent LEDs are smaller lights in the hilt that work independently from the main blade. They can light a crystal chamber, illuminate a switch, show battery level, pulse, mirror blade channels, react to sound, or run blinking patterns.
The Crystal Focus X supports up to 9 accent LED outputs for hilt lighting features such as crystal chambers, AV switches, chassis LEDs, and battery indicators. Not all of those outputs are true PWM outputs, so some can fade smoothly while others are digital-only.
These are the 9 discrete LED outputs on the CFX board, labeled ACCENT1 through ACCENT8, plus GPIO4. They work with individual LEDs such as crystal chamber LEDs, illuminated AV switches, and chassis lighting.
Not all 9 outputs have the same capabilities:
| Output | Type | Capabilities |
|---|---|---|
| Accent #1 | Digital only | ON / OFF switching |
| Accent #2 | PWM | Variable brightness (10-bit) |
| Accent #3 | Digital only | ON / OFF switching |
| Accent #4 | Digital only | ON / OFF switching |
| Accent #5 | PWM | Variable brightness (10-bit) |
| Accent #6 | PWM | Variable brightness (10-bit) |
| Accent #7 | PWM | Variable brightness (10-bit) |
| Accent #8 | PWM | Variable brightness (10-bit) |
| Accent #9 (GPIO4) | PWM | Variable brightness (10-bit) |
PWM outputs, which are accents 2, 5, 6, 7, 8, and 9, can produce smooth brightness control. That makes them ideal for pulsing, fading, audio-reactive flicker, blade color mirroring, and crystal color pulsing.
Digital-only outputs, which are accents 1, 3, and 4, can only switch fully ON or fully OFF. You can still assign PWM-style behaviors such as self-pulsing or audio flicker to them, but they will blink between ON and OFF instead of fading smoothly.
/extra/ACCENTS/
├── 0-Default/
│ └── leds.txt
├── 1-Breathing/
│ └── leds.txt
├── 2-RainbowChase/
│ └── leds.txt
└── ...
Each subfolder uses a numbered naming style similar to font folders. The number is the style index you reference from config.txt.
[profile=0]
style_accents=0
| Config Key | Purpose |
|---|---|
style_accents=N | Selects the PWM accent sequence subfolder index from /extra/ACCENTS/ |
Different blade profiles can use different accent styles, so switching blade profiles can also change the hilt lighting behavior.
leds.txt FileThe leds.txt file defines how the 9 accent outputs behave. It has two main parts: global settings at the top, and one or more state sections below.
The accents= line is the most important setting. Each character controls one accent output from left to right, meaning accent 1 through accent 9.
accents=aappp12Oa
| Char | Name | Behavior |
|---|---|---|
a | Regular | Follows the ON / OFF sequence pattern in the active section |
m | Morphing | Fades between ON and OFF states instead of snapping |
r | Random | Randomly ON or OFF each step |
p | PLI | Part of the power level indicator bargraph |
o | Board Power | Always ON while the board is awake |
O | Blade Indicator | ON when the blade is ignited |
1 | Mirror Channel 1 | Mirrors blade color channel 1 |
2 | Mirror Channel 2 | Mirrors blade color channel 2 |
3 | Mirror Channel 3 | Mirrors blade color channel 3 |
4 | Mirror Channel 4 | Mirrors blade color channel 4 |
C, R, Y, S | Crystal Pulse | Pulses using crystal chamber color channels |
~ | Self-Pulsing | Breathes using accpulsel and accpulsed |
@ | Audio Flicker | Brightness follows audio volume |
# | Reverse Audio | Inverse of audio volume |
u | USB Mirror | Blinks on USB serial Rx / Tx activity |
t | Temp Cool-Down | Brightness reflects blade temperature behavior |
T | Self Cool-Down | Starts bright and decays over time |
b | Blade Brightness | Mirrors overall blade brightness |
B | Blade Dimness | Inverse of blade brightness |
l | Low Battery | Turns ON when battery is low |
L | Low Battery Off | Turns OFF when battery is low |
Polarity tells the firmware how each accent LED is physically wired, so the LED behaves correctly without you having to change your sequences or rewire the hardware.
polarity=NNNNNNNNN
| Char | Meaning | What it means in practice |
|---|---|---|
N | Normal polarity | Use this for common cathode wiring. A HIGH signal turns the LED on and a LOW signal turns it off. |
R | Reversed polarity | Use this for common anode wiring. The logic is inverted, so a LOW signal turns the LED on and a HIGH signal turns it off. |
Common cathode, which is the normal N setting, means the LED shares ground and the accent output drives it in the usual way.
Common anode, which uses R, means the LED shares its positive supply instead. That flips the logic.
When you set an accent to R, the firmware flips the behavior for you. Digital ON and OFF states are inverted, and PWM brightness is mirrored as well, so the effect still looks correct on the LED.
Why this is useful: Different LED modules, illuminated switches, and custom hilt installs do not all use the same wiring convention. Polarity lets you adapt in software, so sequences, pulsing, audio flicker, and PLI still behave normally even when the physical wiring is inverted.
| Key | Description | Default |
|---|---|---|
accpulsed=N | Pulse depth from 0 to 100% | 0 |
accpulsel=N | Pulse period in milliseconds | 1000 |
These can appear at the top of the file or inside a section. They control self-pulsing and crystal-pulsing accent behaviors.
| Section Header | When Active |
|---|---|
[IDLE] | Saber is powered on but blade is off |
[LEDS] | Blade is ignited |
[LOCKUP] | During lockup |
[POWERON] | During ignition |
[POWEROFF] | During retraction |
[PREON] | During pre-ignition effect |
[POSTOFF] | During post-retraction effect |
[FOREVER] | Overrides all other sections if defined |
A <forever> block loops indefinitely:
[LEDS]
<forever>
delay=200
state=100000000
state=010000000
state=001000000
state=000100000
</forever>
A <repeat=N> block plays a set number of times, then moves on:
[POWERON]
<repeat=3>
delay=50
state=111111111
state=000000000
</repeat>
stop
Each state= line defines the ON and OFF values for all 9 accent outputs, from left to right.
state=101000010
Important: Only accents using regular, morphing, or random behavior actually follow the state= sequence. Accents assigned to PLI, mirroring, pulsing, or other special behaviors ignore the state pattern and run their own logic.
delay= sets how long the following states are held in milliseconds. If no delay is set, the default is 100 ms.
delay=200
state=110000000
state=001100000
delay=500
state=000011000
leds.txt Example// Crystal chamber mirrors blade color, PLI bargraph, pulsing switch, chase blinkies
accents=123ppp~aa
polarity=NNNNNNNNN
accpulsed=60
accpulsel=2000
[IDLE]
<forever>
delay=800
state=000000010
state=000000001
</forever>
[LEDS]
<forever>
delay=150
state=000000010
state=000000001
</forever>
[POWERON]
<repeat=4>
delay=40
state=000000011
state=000000000
</repeat>
stop
[POWEROFF]
<repeat=3>
delay=100
state=000000010
state=000000001
state=000000000
</repeat>
stop
[LOCKUP]
<forever>
delay=60
state=000000011
state=000000000
</forever>
The PLI system turns one or more accent LEDs into a battery level bargraph. Assign the p attribute to consecutive accents.
accents=aapppppaa
| Config Key | Description | Default |
|---|---|---|
plilh=LOW,HIGH | Battery voltage range in millivolts | 3400,4200 |
plirev=1 | Reverse the PLI direction | 0 |
When the battery drops below 10%, the last lit LED blinks as a warning.
| Saber Event | Accent Section |
|---|---|
| Board powers on, blade off | [IDLE] |
| Pre-ignition effect starts | [PREON] |
| Blade ignites | [POWERON] then [LEDS] |
| Blade fully on, normal use | [LEDS] |
| Lockup begins | [LOCKUP] |
| Lockup ends | Back to [LEDS] |
| Blade retracts | [POWEROFF] then [IDLE] |
| Post-retraction effect | [POSTOFF] |
If [FOREVER] is defined, it overrides all other sections and plays constantly regardless of saber state.
When a theme is active, the firmware looks for accent files inside the theme folder first. If it does not find them there, it falls back to the global accent path.
//extra/ACCENTS/0-Default/leds.txt
| Key | Purpose |
|---|---|
style_accents=N | PWM accent style subfolder index |
accpulsed=N | Global pulse depth |
accpulsel=N | Global pulse period |
plilh=LOW,HIGH | PLI voltage range in millivolts |
plirev=1 | Reverse PLI direction |
| Char | Behavior |
|---|---|
a | Regular sequenced ON / OFF |
m | Morphing fade |
r | Random ON / OFF |
p | PLI battery bargraph |
o | Board powered |
O | Blade-on indicator |
1–4 | Mirror blade channel |
C, R, Y, S | Crystal color pulse |
~ | Self-pulsing |
@ | Audio reactive |
# | Reverse audio reactive |
u | USB activity |
t | Temperature cool-down |
T | Self cool-down |
b | Blade brightness mirror |
B | Blade dimness |
l | Low battery indicator |
L | Low battery off |
leds.txt Syntax| Element | Syntax | Description |
|---|---|---|
| Section | [LEDS], [IDLE], etc. | State-specific sequence section |
| Attributes | accents=aappp12Oa | Per-accent behavior, left = accent 1 |
| Polarity | polarity=NNNNNNNNN | Per-accent polarity |
| Delay | delay=200 | Hold time in ms |
| State | state=101010101 | ON / OFF per accent, left = accent 1 |
| Pulse depth | accpulsed=50 | 0–100% |
| Pulse period | accpulsel=1000 | Milliseconds |
| Forever block | <forever> ... </forever> | Infinite loop |
| Repeat block | <repeat=N> ... </repeat> | Play N times |
| Stop | stop | Do not loop after repeat finishes |
| Parameter | Maximum |
|---|---|
| Accent outputs | 9 |
| Steps per sequence block | 32 |
| Blocks per section | 16 |
Sections per leds.txt file | 8 |