Allow pin overrides on splits
This commit is contained in:
parent
999a9507b5
commit
659201439f
3 changed files with 10 additions and 4 deletions
|
@ -9,7 +9,7 @@ to syncronize the halves allowing additional features in some extentions.
|
|||
from kb import data_pin
|
||||
:from kmk.modules.split import Split, SplitType
|
||||
|
||||
split = Split(split_type=Split.UART, data_pin=data_pin, split_side=SplitSide.LEFT)
|
||||
split = Split(split_side=SplitSide.LEFT)
|
||||
keyboard.modules.append(split)
|
||||
```
|
||||
|
||||
|
@ -54,8 +54,10 @@ longer than 11 characters. Instructions on how to do that are
|
|||
[here](https://learn.adafruit.com/welcome-to-circuitpython/the-circuitpy-drive).
|
||||
For example on NYQUISTL for left and NYQUISTR for the right.
|
||||
|
||||
For wired connections you are done. For bluetooth, remove the `split_side` like this
|
||||
For wired connections you don't need to pass anything. For bluetooth, remove the `split_side` like this
|
||||
```python
|
||||
split = Split(split_type=Split.UART, data_pin=data_pin)
|
||||
# Wired
|
||||
split = Split()
|
||||
# Wireless
|
||||
split = Split(split_type=Split.BLE)
|
||||
```
|
||||
|
|
|
@ -89,6 +89,10 @@ class Split(Module):
|
|||
name = str(getmount('/').label)
|
||||
if self.split_type == SplitType.BLE:
|
||||
self._ble.name = name
|
||||
else:
|
||||
# Try to guess data pins if not supplied
|
||||
if not self.data_pin:
|
||||
self.data_pin = keyboard.data_pin
|
||||
|
||||
# Detect split side from name
|
||||
if self.split_side is None:
|
||||
|
|
|
@ -16,7 +16,7 @@ keyboard.tap_time = 150
|
|||
layers = Layers()
|
||||
modtap = ModTap()
|
||||
rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5)
|
||||
split = Split(data_pin=keyboard.data_pin)
|
||||
split = Split()
|
||||
|
||||
keyboard.modules = [modtap, layers, split]
|
||||
keyboard.extensions = [rgb_ext]
|
||||
|
|
Loading…
Add table
Reference in a new issue