Files
kmk_firmware/docs/power.md
Kyle Brown c2c456ce1a Docs added
2020-11-13 23:27:48 -08:00

40 lines
1.2 KiB
Markdown

# Power(save)
This extention allows you to save power and is targeted to bluetooth/battery based keyboards.
## Keycodes
|Key |Description |
|-----------------------|-------------------------|
|`KC.PS_TOG ` |Toggles powersave on/off |
|`KC.PS_ON ` |Turns powersave on |
|`KC.PS_OFF ` |Turns powersave off |
# Enabling the extention
To turn on basic power saving, this is all that is required.
```python
from kmk.extensions.power import Power
power = Power()
keyboard.extensions.append(power)
```
## Optional extra power saving
On supported boards, such as the nice!nano, power can be cut on VCC saving extra power if OLEDS or RGBs are installed.
These drain power even when off, so this will prevent them from doing it.
```python
from kmk.extensions.power import Power
# Your kb.py may already have this set. If not, add it like this
# import board
# keyboard.powersave_pin = board.P0_13
power = Power(powersave_pin=keyboard.powersave_pin)
keyboard.extensions.append(power)
```
Make sure that the pin is correct for your microcontroller. The example is for the nice!nano. Not all microcontrollers
have this feature and this can be omitted if not and there will simply be less power saving.