update documentation
This commit is contained in:
parent
65f48b53a4
commit
91562abde9
31
docs/led.md
31
docs/led.md
@ -3,13 +3,13 @@ Want your keyboard to shine? Add some lights!
|
|||||||
|
|
||||||
## Enabling the extension
|
## Enabling the extension
|
||||||
The only required values that you need to give the LED extension would be the
|
The only required values that you need to give the LED extension would be the
|
||||||
pixel pin, and the number of pixels/LED's. If using a split keyboard, this number
|
`led_pin`. It can either be a single board pin, or a list of pins for multiple
|
||||||
is per side, and not the total of both sides.
|
LED's.
|
||||||
```python
|
```python
|
||||||
from kmk.extensions.RGB import RGB
|
from kmk.extensions.LED import LED
|
||||||
from kb import led_pin # This can be imported or defined manually
|
import board
|
||||||
|
|
||||||
led_ext = LED(led_pin=led_pin)
|
led_ext = LED(led_pin=[board.GP0, board.GP1])
|
||||||
keyboard.extensions.append(led_ext)
|
keyboard.extensions.append(led_ext)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -17,14 +17,28 @@ keyboard.extensions.append(led_ext)
|
|||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|-----------------------------|-------------------|----------------------------|
|
|-----------------------------|-------------------|----------------------------|
|
||||||
|`KC.LED_TOG` | |Toggles LED's |
|
|`KC.LED_TOG()` | |Toggles LED's |
|
||||||
|`KC.LED_INC` | |Increase Brightness |
|
|`KC.LED_INC()` | |Increase Brightness |
|
||||||
|`KC.LED_DEC` | |Decrease Brightness |
|
|`KC.LED_DEC()` | |Decrease Brightness |
|
||||||
|
|`KC.LED_SET()` | |Set Brightness |
|
||||||
|`KC.LED_ANI` | |Increase animation speed |
|
|`KC.LED_ANI` | |Increase animation speed |
|
||||||
|`KC.LED_AND` | |Decrease animation speed |
|
|`KC.LED_AND` | |Decrease animation speed |
|
||||||
|`KC.LED_MODE_PLAIN` |`LED_M_P` |Static LED's |
|
|`KC.LED_MODE_PLAIN` |`LED_M_P` |Static LED's |
|
||||||
|`KC.LED_MODE_BREATHE` |`LED_M_B` |Breathing animation |
|
|`KC.LED_MODE_BREATHE` |`LED_M_B` |Breathing animation |
|
||||||
|
|
||||||
|
Keycodes with arguments can affect all, or a selection of LED's.
|
||||||
|
```python
|
||||||
|
# toggle all LEDs
|
||||||
|
LED_TOG_ALL = KC.LED_TOG()
|
||||||
|
|
||||||
|
# increase brightness of first LED
|
||||||
|
LED_INC_0 = KC.LED_INC(0)
|
||||||
|
|
||||||
|
# decrease brightness of second and third LED
|
||||||
|
LED_DEC_1_2 = KC.LED_DEC(1,2)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
All of these values can be set by default for when the keyboard boots.
|
All of these values can be set by default for when the keyboard boots.
|
||||||
```python
|
```python
|
||||||
@ -36,6 +50,7 @@ led_ext = LED(
|
|||||||
breathe_center=1.5,
|
breathe_center=1.5,
|
||||||
animation_mode=AnimationModes.STATIC,
|
animation_mode=AnimationModes.STATIC,
|
||||||
animation_speed=1,
|
animation_speed=1,
|
||||||
|
user_animation=None,
|
||||||
val=100,
|
val=100,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user