kmk_firmware/docs/power.md
Ryan Rotter 1985712637 spelling/capitalization/usage on proper nouns
correct usage sourced from:
  * websites of respective trademark holders
  * Wiktionary
  * Wikipedia
2022-04-25 16:53:22 +00:00

43 lines
1.2 KiB
Markdown

# Power(save)
This module 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 extension
To turn on basic power saving, this is all that is required.
```python
from kmk.modules.power import Power
power = Power()
keyboard.modules.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 so.
```python
from kmk.modules.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.modules.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.