Revert "Monocolor LED backlight added"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Debugging
|
||||
Debug will output most of the useful state to the console. This can be enable in your firmware
|
||||
by setting this in your keymap. NOTE that it will be slower, so only enable this when you
|
||||
by setting this in your keymap. NOTE that it will be MUCH slower, so only enable this when you
|
||||
need debugging.
|
||||
```python
|
||||
DEBUG_ENABLE = True
|
||||
|
@@ -1,16 +0,0 @@
|
||||
# Examples
|
||||
Here you can find some examples of what some users have created in their personal keyboard configs. These are here to
|
||||
help you understand how some of the tools may be used.
|
||||
|
||||
## Changing LED color based on layers
|
||||
This allows you to create a layer key that also changes colors when pushing a layer key, and restore turn off the lights
|
||||
when you release the layer key. The example uses the MO though any layer switch keys can be used if imported. Just use the
|
||||
LAYER_1 key in your keymap, and it's ready to go! You can change animations, colors, or anything in there.
|
||||
|
||||
```python
|
||||
LAYER_1 = KC.MO(1)
|
||||
LAYER_1.after_press_handler(lambda *args, **kwargs: keyboard.pixels.set_hsv_fill(100, 100, 100))
|
||||
LAYER_1.after_release_handler(lambda *args, **kwargs: keyboard.pixels.set_hsv_fill(0, 0, 0))
|
||||
|
||||
keyboard.keymap = [ ....... LAYER_1 ....... ]
|
||||
```
|
@@ -5,41 +5,22 @@ as appropriate (see [Adafruit's
|
||||
documentation](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython),
|
||||
though it doesn't cover all CircuitPython boards - you may need to glance around
|
||||
the CircuitPython source or ask on Discord). We primarily target CircuitPython
|
||||
4.0-alpha1 to 4.0-alpha2. You'll only need
|
||||
4.0-alpha1 and above, though many features should work on 3.x. You'll only need
|
||||
to flash CircuitPython once (unless we update our baseline supported version).
|
||||
|
||||
After CircuitPython has been flashed, a `CIRCUITPY` drive should show up on your
|
||||
computer most likely. If not, check out the troubleshooting section below.
|
||||
computer (some Linux/BSD users without drive automounting will want to poke
|
||||
around `dmesg` to find the drive identifier and mount this drive manually
|
||||
somewhere - ex. `mkdir -p ~/mnt && sudo mount -o uid=1000,gid=1000 /dev/sdf1
|
||||
~/mnt`, where `uid` and `gid` are your user ID and primary group ID, as found in
|
||||
`id -u` and `id -g`). Take note of the path that this is mounted to (for MacOS
|
||||
users, this will probably look something like `/Volumes/CIRCUITPY`).
|
||||
|
||||
# Windows
|
||||
Currently, we do not have an official "flasher" for windows. You can manually install it fairly easily and we recommend
|
||||
checking out the support page to join the community if you have any questions. An actual tool is in development.
|
||||
Alternatively, you can flash from any linux like tool set (Cygwin, WSL, ect) using the Linux guide below.
|
||||
|
||||
# Mac
|
||||
Until an interactive installer is created, please follow the linux instructions replacing /mnt with /Volumes
|
||||
|
||||
# Linux
|
||||
|
||||
While in the directory for kmk, simply run this, changing the mount point and keymap name to whatever is appropriate.
|
||||
To "flash" all of KMK, your keymap, and a basic `main.py` that will start
|
||||
everything up, run `make MOUNTPOINT=/path/to/wherever
|
||||
USER_KEYMAP=path/to/keymap.py`. For example, if my `CIRCUITPY` volume is mounted
|
||||
to `~/mnt`, I might flash my development breadboard with the following:
|
||||
|
||||
```sh
|
||||
make MOUNTPOINT=/mnt/CIRCUITPY USER_KEYMAP=user_keymaps/nameofyourkeymap.py
|
||||
make MOUNTPOINT=~/mnt USER_KEYMAP=user_keymaps/klardotsh/itsybitsy_m4_express/threethree.py
|
||||
```
|
||||
|
||||
# Troubleshooting
|
||||
## Windows
|
||||
Please check out our support page to get in contact with us and the community and we can gladly help you out.
|
||||
|
||||
## Mac
|
||||
Please check out our support page to get in contact with us and the community and we can gladly help you out.
|
||||
|
||||
## Linux/BSD
|
||||
Check to see if your drive may have mounted elsewhere with a gui tool. Most will give you the directory in the GUI.
|
||||
If it's not mounted, you can read up on how to mount a drive manually [here](https://wiki.archlinux.org/index.php/File_systems#Mount_a_file_system)
|
||||
|
||||
It would look something like this
|
||||
|
||||
`sudo mount -o uid=1000,gid=1000 /dev/sdf1 ~/mnt`
|
||||
|
||||
If you still are having issues, check out our support page to see where you can come say hi and the community will gladly help you out.
|
||||
|
@@ -4,32 +4,45 @@
|
||||
| ----- | ------- | --------------- | ----- |
|
||||
| [Adafruit Feather M4 Express](https://www.adafruit.com/product/3857) | Atmel SAMD51 (Cortex M4F) | CircuitPython | An economical solution for basic USB keyboards |
|
||||
| [Adafruit ItsyBitsy M4 Express](https://www.adafruit.com/product/3800) | Atmel SAMD51 (Cortex M4F) | CircuitPython | A smaller solution for basic USB keyboards |
|
||||
| [Adafruit Feather NRF52840 Express](https://www.adafruit.com/product/4062) | Cortex M4F/nrf52840 | CircuitPython | Supports USB HID and soon BLE (Bluetooth) |
|
||||
| [Seeed nRF52840 Micro Dev Kit](https://www.seeedstudio.com/nRF52840-Micro-Development-Kit-p-3079.html) | M4F/nrf52840 | CircuitPython | Supports USB HID and soon BLE (Bluetooth) |
|
||||
|
||||
## Community Supported
|
||||
| Board | Chipset | Python Platform | Maintainer | Notes |
|
||||
| ----- | ------- | --------------- | ----- | ----- |
|
||||
| [pyboard v1.1](https://www.adafruit.com/product/2390) | STM32F405RG (Cortex M4F) | MicroPython | kdb424 | Very large and expensive, and has ram limitations. |
|
||||
|
||||
## Support Planned/WIP
|
||||
| Board | Chipset | Python Platform | Notes |
|
||||
| ----- | ------- | --------------- | ----- |
|
||||
| [Planck rev6 Keyboard](https://olkb.com/planck) | STM32F303 | CircuitPython | Requires porting CircuitPython to STM32F3. |
|
||||
| [Proton C Controller?](https://olkb.com/parts/qmk-proton-c) | STM32F303CCT6 | CircuitPython | Requires porting CircuitPython to STM32F3. |
|
||||
| [Seeed nRF52840 Micro Dev Kit](https://www.seeedstudio.com/nRF52840-Micro-Development-Kit-p-3079.html) | nRF52840 | [CircuitPython](https://github.com/KMKfw/circuitpython/tree/topic-nrf52840-mdk) | This is basically as bleeding edge as it gets. Will support BLE HID to PC as well as BLE split boards |
|
||||
| [Planck rev6 Keyboard](https://olkb.com/planck) | STM32 of some sort | MicroPython | Requires porting MicroPython to STM32F3, this work has begun but I'm pretty terrible at it. |
|
||||
| [Proton C Controller?](https://www.reddit.com/r/MechanicalKeyboards/comments/87cw36/render_of_the_qmk_proton_c_qmkpowered_pro_micro/) | ??? | ??? | Does not exist yet, the controller from a Planck rev6 in a Pro Micro pin-compat controller chip |
|
||||
|
||||
|
||||
## Unsupported Devices
|
||||
|
||||
|
||||
Here's a list of problematic, but possibly usable microcontrollers:
|
||||
|
||||
| Board | Chipset | Python Platform | Notes |
|
||||
| ----- | ------- | --------------- | ------------------ |
|
||||
| [Adafruit Feather Huzzah](https://www.adafruit.com/product/2821) | ESP8266 | CircuitPython | Suuuuuper limited on GPIO lanes, Lack USB HID (HW) |
|
||||
| [Adafruit HUZZAH32](https://www.adafruit.com/product/3405) | ESP32 | MicroPython | This may work as a BLE HID device, or with a GPIO-based USB breakout. Lacks USB HID (HW) |
|
||||
| [Adafruit Feather nRF52 BLE Controller](https://www.adafruit.com/product/3406) | nRF52832 | CircuitPython | Lacks USB HID (HW), but could be fixed with GPIO USB breakout. BLE HID should be possible, but it's considered somewhat unstable. This chip is considered "mostly unsupported" in CircuitPython at the time of writing. |
|
||||
|
||||
## Porting new devices
|
||||
Pull requests are welcome and encouraged to add support for new
|
||||
keyboards/microcontrollers. The base requirements for device support
|
||||
- CircuitPython
|
||||
- CircuitPython or MicroPython
|
||||
- 256KB of flash storage
|
||||
- HID over USB and/or Bluetooth.
|
||||
- HID over USB or Bluetooth.
|
||||
|
||||
## Secondary Support
|
||||
|
||||
In the future, secondary support for lesser controllers is planned. One of
|
||||
In the future, secondary support for lesser contollers is planned. One of
|
||||
these cases is the pro micro being used for a slave half of a split keyboard
|
||||
while all actual work is being done by a supported board. This could also be
|
||||
used to convert boards that use USB or i2c that run lesser chips to a KMK
|
||||
board, with a supported board acting as a translation layer. Support for
|
||||
a converter is planned with the inspiration coming from the [Hasu USB to
|
||||
USB Controller Converter](https://www.1upkeyboards.com/shop/controllers/usb-to-usb-converter/)
|
||||
and would allow for conversion to KMK as opposed to TMK or QMK with that board.
|
||||
USB Controller Converter](https://www.1upkeyboards.com/shop/controllers/usb-to-usb-converter/) and would allow for conversion to KMK as
|
||||
opposed to TMK or QMK with that board.
|
@@ -230,40 +230,3 @@
|
||||
|`KC.RALT(kc)`|Hold Right Alt and press `kc` |
|
||||
|`KC.RGUI(kc)`|Hold Right GUI and press `kc` |
|
||||
|
||||
## [RGB/Underglow]
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|-----------------------------|-------------------|----------------------------|
|
||||
|`KC.RGB_TOG` | |Toggles RGB |
|
||||
|`KC.RGB_HUI` | |Increase Hue |
|
||||
|`KC.RGB_HUD` | |Decrease Hue |
|
||||
|`KC.RGB_SAI` | |Increase Saturation |
|
||||
|`KC.RGB_SAD` | |Decrease Saturation |
|
||||
|`KC.RGB_VAI` | |Increase Value |
|
||||
|`KC.RGB_VAD` | |Decrease Value |
|
||||
|`KC.RGB_MODE_PLAIN` |`RGB_M_P` |Static RGB |
|
||||
|`KC.RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation |
|
||||
|`KC.RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation |
|
||||
|`KC.RGB_MODE_BREATHE_RAINBOW`|`RGB_M_BR` |Breathing rainbow animation |
|
||||
|`KC.RGB_MODE_KNIGHT` |`RGB_M_K` |Knightrider animation |
|
||||
|
||||
|
||||
## [Mod-Tap Keys] NOT IMPLEMENTED AT THIS TIME
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|------------|---------------------------------------|-------------------------------------------------------|
|
||||
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
||||
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
||||
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|
||||
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|
||||
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|
||||
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
@@ -1,10 +1,10 @@
|
||||
# Keys
|
||||
|
||||
> NOTE: This is not a lookup table of key objects provided by KMK. That listing
|
||||
> can be found in `keycodes.md`. It's probably worth a look at the raw source if
|
||||
> you're stumped: `kmk/keys.py`.
|
||||
> can be found in `keycodes.md`, though that file is not always kept up to date.
|
||||
> It's probably worth a look at the raw source if you're stumped: `kmk/keys.py`.
|
||||
|
||||
This is a bunch of documentation about how a physical keypress translates to
|
||||
This is a bunch of documentation about how physical keypresses translate to
|
||||
events (and the lifecycle of said events) in KMK. It's somewhat technical, but
|
||||
if you're looking to extend your keyboard's functionality with extra code,
|
||||
you'll need at least some of this technical knowledge.
|
||||
|
82
docs/led.md
82
docs/led.md
@@ -1,82 +0,0 @@
|
||||
# LED (Mono color backlight)
|
||||
Want your keyboard to shine? Add some lights!
|
||||
|
||||
## [Keycodes]
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|-----------------------------|-------------------|----------------------------|
|
||||
|`KC.LED_TOG` | |Toggles LED's |
|
||||
|`KC.LED_INC` | |Increase Brightness |
|
||||
|`KC.LED_DEC` | |Decrease Brightness |
|
||||
|`KC.LED_ANI` | |Increase animation speed |
|
||||
|`KC.LED_AND` | |Decrease animation speed |
|
||||
|`KC.LED_MODE_PLAIN` |`LED_M_P` |Static LED's |
|
||||
|`KC.LED_MODE_BREATHE` |`LED_M_B` |Breathing animation |
|
||||
|
||||
## Configuration
|
||||
|Define |Default |Description |
|
||||
|-----------------------------------------|-------------|------------------------------------------------|
|
||||
|`keyboard.led_config['brightness_step']` |`5` |The number of steps to change the brightness by |
|
||||
|`keyboard.led_config['brightness_limit']`|`100` |The maximum brightness level in percent |
|
||||
|
||||
## Built-in Animation Configuration
|
||||
|Define |Default |Description |
|
||||
|-----------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
||||
|`keyboard.led_config['breath_center']` |`1.5` |Used to calculate the curve for the breathing animation. Anywhere from 1.0 - 2.7 is valid|
|
||||
|
||||
## Functions
|
||||
|
||||
If you want to create your own animations, or for example, change the lighting in a macro, or a layer switch, here are some functions that are available.
|
||||
|
||||
|Function |Description |
|
||||
|--------------------------------------------|--------------------------------------------------------------------------------------------|
|
||||
|`keyboard.pixels.increase_brightness(step)` |Increases hue by a given step |
|
||||
|`keyboard.pixels.decrease_brightness(step)` |Decreases hue by a given step |
|
||||
|`keyboard.pixels.set_brightness(percent)` |Increases saturation by a given step |
|
||||
|
||||
## Direct variable access
|
||||
|Define |Default |Description |
|
||||
|-----------------------------------|-----------|--------------------------------------------------------------------------------------------------------|
|
||||
|`keyboard.led.brightness` |`0` |Sets the brightness by percent 0-100 |
|
||||
|`keyboard.led.brightness_limit` |`100` |Sets the limit of brightness |
|
||||
|`keyboard.led.brightness_step` |`5` |Sets the step value to change brightness by |
|
||||
|`keyboard.led.animation_mode` |`static` |This can be changed to any modes included, or to something custom for user animations. Any string is valid |
|
||||
|`keyboard.led.animation_speed` |`1` |Increases animation speed of most animations. Recommended 1-5, Maximum 10. |
|
||||
|
||||
## User animations
|
||||
User animations can be created as well. An example of a light show would look like this
|
||||
```python
|
||||
from kmk.keys import make_key
|
||||
|
||||
def start_flicker(*args, **kwargs):
|
||||
# Setting mode to user will use the user animation
|
||||
keyboard.led.animation_mode = 'user'
|
||||
|
||||
|
||||
def flicker(self):
|
||||
# This is the code that is run every cycle that can serve as an animation
|
||||
# Refer to the kmk/rgb.py for actual examples of what has been done
|
||||
if self.brightness == 0:
|
||||
self.brightness = 100
|
||||
else:
|
||||
self.brightness = 0
|
||||
keyboard.led.set_brightness(self.brightness)
|
||||
return self
|
||||
|
||||
|
||||
# This is what "gives" your function to KMK so it knows what your animation code is
|
||||
keyboard.led_config['user_animation'] = flicker
|
||||
|
||||
# Makes a key that would start your animation
|
||||
LS = make_key(on_press=start_flicker())
|
||||
|
||||
keymap = [...LS,...]
|
||||
```
|
||||
|
||||
# Troubleshooting
|
||||
Make sure that your board supports LED backlight by checking for a line with "LED_PIN". If it does not, you can add it to your keymap.
|
||||
|
||||
|Define |Description |
|
||||
|---------------------|---------------------------------------------|
|
||||
|`keyboard.led_pin` |The pin connected to the data pin of the LEDs|
|
||||
|
148
docs/rgb.md
148
docs/rgb.md
@@ -1,148 +0,0 @@
|
||||
# RGB/Underglow/Neopixel
|
||||
Want your keyboard to shine? Add some lights!
|
||||
This does require the neopixel library from Adafruit. This can be downloaded [here](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/blob/6e35cd2b40575a20e2904b096508325cef4a71d3/neopixel.py).
|
||||
It is part of the [Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).
|
||||
|
||||
Simply put this in the "root" of your circuitpython device. If unsure, it's the folder with main.py in it, and should be the first folder you see when you open the device.
|
||||
|
||||
Currently we support the following addressable LEDs:
|
||||
|
||||
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
||||
* SK6812, SK6812MINI, SK6805
|
||||
* All neopixels
|
||||
|
||||
### Color Selection
|
||||
|
||||
KMK uses [Hue, Saturation, and Value](https://en.wikipedia.org/wiki/HSL_and_HSV) to select colors rather than RGB. The color wheel below demonstrates how this works.
|
||||
|
||||
Changing the **Hue** cycles around the circle.
|
||||
Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color.
|
||||
Changing the **Value** sets the overall brightness.
|
||||
|
||||
## [Keycodes]
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|-----------------------------|-------------------|----------------------------|
|
||||
|`KC.RGB_TOG` | |Toggles RGB |
|
||||
|`KC.RGB_HUI` | |Increase Hue |
|
||||
|`KC.RGB_HUD` | |Decrease Hue |
|
||||
|`KC.RGB_SAI` | |Increase Saturation |
|
||||
|`KC.RGB_SAD` | |Decrease Saturation |
|
||||
|`KC.RGB_VAI` | |Increase Value |
|
||||
|`KC.RGB_VAD` | |Decrease Value |
|
||||
|`KC.RGB_ANI` | |Increase animation speed |
|
||||
|`KC.RGB_AND` | |Decrease animation speed |
|
||||
|`KC.RGB_MODE_PLAIN` |`RGB_M_P` |Static RGB |
|
||||
|`KC.RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation |
|
||||
|`KC.RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation |
|
||||
|`KC.RGB_MODE_BREATHE_RAINBOW`|`RGB_M_BR` |Breathing rainbow animation |
|
||||
|`KC.RGB_MODE_KNIGHT` |`RGB_M_K` |Knightrider animation |
|
||||
|
||||
## Configuration
|
||||
|Define |Default |Description |
|
||||
|-------------------------------------|-------------|-----------------------------------------------------------------------------|
|
||||
|`keyboard.rgb_config['rgb_order']` |`(1, 0, 2)` |The order of the pixels R G B, and optionally white. Example(1, 0, 2, 3) |
|
||||
|`keyboard.rgb_config['hue_step']` |`10` |The number of steps to cycle through the hue by |
|
||||
|`keyboard.rgb_config['sat_step']` |`17` |The number of steps to change the saturation by |
|
||||
|`keyboard.rgb_config['val_step']` |`17` |The number of steps to change the brightness by |
|
||||
|`keyboard.rgb_config['hue_default']` |`0` |The default hue when the keyboard boots |
|
||||
|`keyboard.rgb_config['sat_default']` |`100` |The default saturation when the keyboard boots |
|
||||
|`keyboard.rgb_config['val_default']` |`100` |The default value (brightness) when the keyboard boots |
|
||||
|`keyboard.rgb_config['val_limit']` |`255` |The maximum brightness level |
|
||||
|
||||
## Built-in Animation Configuration
|
||||
|Define |Default |Description |
|
||||
|----------------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
||||
|`keyboard.rgb_config['breathe_center']` |`1.5` |Used to calculate the curve for the breathing animation. Anywhere from 1.0 - 2.7 is valid|
|
||||
|`keyboard.rgb_config['knight_effect_length']` |`4` |The number of LEDs to light up for the "Knight" animation |
|
||||
|
||||
## Functions
|
||||
|
||||
If you want to create your own animations, or for example, change the lighting in a macro, or a layer switch, here are some functions that are available.
|
||||
|
||||
|Function |Description |
|
||||
|--------------------------------------------------|--------------------------------------------------------------------------------------------|
|
||||
|`keyboard.pixels.set_hsv_fill(hue, sat, val)` |Fills all LED's with HSV values |
|
||||
|`keyboard.pixels.set_hsv(hue, sat, val, index)` |Sets a single LED with HSV value |
|
||||
|`keyboard.pixels.set_rgb_fill((r, g, b))` |Fills all LED's with RGB(W) values |
|
||||
|`keyboard.pixels.set_rgb((r, g, b), index)` |Set's a single LED with RGB(W) values |
|
||||
|`keyboard.pixels.disable_auto_write(bool)` |When True, disables showing changes. Good for setting multiple LED's before a visible update|
|
||||
|`keyboard.pixels.increase_hue(step)` |Increases hue by a given step |
|
||||
|`keyboard.pixels.decrease_hue(step)` |Decreases hue by a given step |
|
||||
|`keyboard.pixels.increase_sat(step)` |Increases saturation by a given step |
|
||||
|`keyboard.pixels.decrease_sat(step)` |Decreases saturation by a given step |
|
||||
|`keyboard.pixels.increase_val(step)` |Increases value (brightness) by a given step |
|
||||
|`keyboard.pixels.decrease_val(step)` |Decreases value (brightness) by a given step |
|
||||
|`keyboard.pixels.increase_ani()` |Increases animation speed by 1. Maximum 10 |
|
||||
|`keyboard.pixels.decrease_ani()` |Decreases animation speed by 1. Minimum 10 |
|
||||
|`keyboard.pixels.off()` |Turns all LED's off |
|
||||
|`keyboard.pixels.show()` |Displays all stored configuration for LED's. Useful with disable_auto_write explained below |
|
||||
|`keyboard.pixels.time_ms()` |Returns a time in ms since the board has booted. Useful for start/stop timers |
|
||||
|
||||
## Direct variable access
|
||||
|Define |Default |Description |
|
||||
|-----------------------------------|-----------|-----------------------------------------------------------------------------------------------------------|
|
||||
|`keyboard.pixels.hue` |`0` |Sets the hue from 0-360 |
|
||||
|`keyboard.pixels.sat` |`100` |Sets the saturation from 0-100 |
|
||||
|`keyboard.pixels.val` |`80` |Sets the brightness from 1-255 |
|
||||
|`keyboard.pixels.reverse_animation`|`False` |If true, some animations will run in reverse. Can be safely used in user animations |
|
||||
|`keyboard.pixels.animation_mode` |`static` |This can be changed to any modes included, or to something custom for user animations. Any string is valid |
|
||||
|`keyboard.pixels.animation_speed` |`1` |Increases animation speed of most animations. Recommended 1-5, Maximum 10. |
|
||||
|
||||
|
||||
## Hardware Modification
|
||||
|
||||
To add RGB LED's to boards that don't support them directly, you will have to add a 3 wires. The power wire will run on 3.3v or 5v (depending on the LED),
|
||||
ground, and data pins will need added to an unused pin on your microcontroller unless your keyboard has specific solder points for them. With those 3 wires
|
||||
connected, set the pixel_pin as described above, and you are ready to use your RGB LED's/Neopixels.
|
||||
|
||||
## ADVANCED USAGE
|
||||
If you wish to interact with these as you would normal LED's and do not want help from KMK, you can disable all helper functions from working and access the
|
||||
neopixel object directly like this.
|
||||
```python
|
||||
keyboard.pixels.disable_auto_write = True
|
||||
keyboard.pixels.neopixel() # <-- This is the neopixel object
|
||||
```
|
||||
|
||||
## User animations
|
||||
User animations can be created as well. An example of a light show would look like this
|
||||
```python
|
||||
from kmk.keys import make_key
|
||||
|
||||
def start_light_show(*args, **kwargs):
|
||||
# Setting mode to user will use the user animation
|
||||
keyboard.pixels.animation_mode = 'user'
|
||||
|
||||
|
||||
def light_show(self):
|
||||
# This is the code that is run every cycle that can serve as an animation
|
||||
# Refer to the kmk/rgb.py for actual examples of what has been done
|
||||
self.hue = (self.hue + 35) % 360
|
||||
keyboard.pixels.set_hsv_fill(self.hue, self.sat, self.val)
|
||||
return self
|
||||
|
||||
|
||||
# This is what "gives" your function to KMK so it knows what your animation code is
|
||||
keyboard.rgb_config['user_animation'] = light_show
|
||||
|
||||
# Makes a key that would start your animation
|
||||
LS = make_key(on_press=start_light_show)
|
||||
|
||||
keymap = [...LS,...]
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
### Incorrect colors
|
||||
If your colors are incorrect, check the pixel order of your specific LED's. Here are some common ones.
|
||||
* WS2811, WS2812, WS2812B, WS2812C are all GRB (1, 0, 2)
|
||||
* SK6812, SK6812MINI, SK6805 are all GRB (1, 0, 2)
|
||||
* Neopixels will vary depending on which one you buy. It will be listed on the product page.# Troubleshooting
|
||||
|
||||
### Lights don't turn on
|
||||
Make sure that your board supports LED backlight by checking for a line with "PIXEL_PIN". If it does not, you can add it to your keymap.
|
||||
If you added the LED's yourself, you will also need to set num_pixels to the number of installed LED's in total.
|
||||
|
||||
|Define |Description |
|
||||
|---------------------|---------------------------------------------|
|
||||
|`keyboard.pixel_pin` |The pin connected to the data pin of the LEDs|
|
||||
|`keyboard.num_pixels`|The number of LEDs connected |
|
@@ -3,9 +3,7 @@
|
||||
Sequences are used for sending multiple keystrokes in a single action, and can
|
||||
be used for things like unicode characters (even emojis! 🇨🇦), lorei epsum
|
||||
generators, triggering side effects (think lighting, speakers,
|
||||
microcontroller-optimized cryptocurrency miners, whatever). If you are still
|
||||
unsure of what this is, most other vendors call these "Macros", but can do much
|
||||
more if you wish.
|
||||
microcontroller-optimized cryptocurrency miners, whatever).
|
||||
|
||||
## Sending strings
|
||||
The most basic sequence is `send_string`. It can be used to send any standard
|
||||
|
@@ -2,22 +2,13 @@
|
||||
Split keyboards are mostly the same as unsplit and very easy to adapt a keymap for. Currently
|
||||
UART is supported, though other modes will come later such as Bluetooth and i2c.
|
||||
|
||||
|
||||
## UART
|
||||
To enable uart it's as simple as adding this line, of course changing the pin
|
||||
```python
|
||||
keyboard.split_type = "UART"
|
||||
keyboard.uart_pin = board.SCL
|
||||
```
|
||||
|
||||
## Config
|
||||
Useful config options:
|
||||
```python
|
||||
keyboard.split_flip = True # If your boards are identical but one is flipped, this option is for you
|
||||
keyboard.split_offsets = [6, 6, 6, 6] # This is the how many keys are on each column on the "Master" half
|
||||
```
|
||||
|
||||
### EE HANDS
|
||||
## EE HANDS
|
||||
If you want to plug in on either side, it can be done fairly easily but requires setup.
|
||||
|
||||
On each half of your keyboard make a file called kmk_side.py and add one of these lines to the file
|
||||
@@ -33,3 +24,9 @@ and then in your keymap, add the line
|
||||
from kmk_side import split_side
|
||||
```
|
||||
|
||||
# UART
|
||||
To enable uart it's as simple as adding this line, of course changing the pin
|
||||
```python
|
||||
keyboard.split_type = "UART"
|
||||
keyboard.uart_pin = board.SCL
|
||||
```
|
||||
|
@@ -1,12 +0,0 @@
|
||||
# Support
|
||||
If you are having any issues in installing, configuring, or otherwise issues with KMK, please reach out to us and
|
||||
our community here.
|
||||
|
||||
# Matrix
|
||||
* [Software Support](https://matrix.to/#/#kmk-support:kmkfw.io)
|
||||
* [Hardware Support](https://matrix.to/#/#kmk-hardware:kmkfw.io)
|
||||
* [General discussion](https://matrix.to/#/#kmk-general:kmkfw.io)
|
||||
|
||||
|
||||
# Discord
|
||||
* [General support](https://discord.gg/NDUau62)
|
@@ -1,6 +1,6 @@
|
||||
# Tap Dance
|
||||
|
||||
Tap dance is a way to allow a single physical key to work as multiple logical
|
||||
Tap dance is a way to allow a single physical key to work as multple logical
|
||||
keys / actions without using layers. With basic tap dance, you can trigger these
|
||||
"nested" keys or macros through a series of taps of the physical key within a
|
||||
given timeout.
|
||||
@@ -34,7 +34,7 @@ are planned to be worked around "eventually", but for now are noteworthy:
|
||||
|
||||
- Super fancy stuff like sending a keypress only when the leader key is released
|
||||
(perhaps based on how long the leader key was held) is **unsupported** - an
|
||||
example use case might be "tap for Home, hold for Shift"
|
||||
example usecase might be "tap for Home, hold for Shift"
|
||||
|
||||
Here's an example of all this in action:
|
||||
|
||||
|
Reference in New Issue
Block a user