Skip to content

Commit

Permalink
Draculad board: corrections applied to pass linter (KMKfw#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunk2k authored and Alex Elias committed Nov 25, 2023
1 parent cf49d17 commit 4801b33
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 52 deletions.
13 changes: 7 additions & 6 deletions boards/draculad/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Draculad
# DracuLad

The [DracuLad](https://github.com/MangoIV/dracuLad) is a feature-packed 30% sized, split bodied, columnar staggered keyboard.

![KeycaplessTopElev](https://github.com/mangoiv/draculad/raw/master/pictures/rev1/both_sides_underglow_oleds.jpg)

The Draculad is is a feature-packed 30% split columnar staggered keyboard.
Retailers (USA)
[Boardsource](https://boardsource.xyz/store)

Extensions enabled by default
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers.
- [ModTap](/docs/en/modtap.md) Allows mod keys to act as different keys when tapped.
- [Split](/docs/en/split_keyboards.md) Connects halves using a wire
- [Split](/docs/en/split_keyboards.md) Connects halves using a wire.
- [peg_RGB_matrix](/docs/en/peg_rgb_matrix.md) Allows mod keys to act as different keys when tapped.
- [peg_oled_display](/docs/en/peg_oled_display.md) Connects halves using a wire
- [peg_oled_display](/docs/en/peg_oled_display.md) Connects halves using a wire.

Common Extensions
- [Power](/docs/enpower.md) Powersaving features for battery life

## Microcontroller support

Update this line in `kb.py` to any supported microcontroller in `kmk/quickpin/pro_micro`:
Replace `boardsource_blok` in `kb.py` to any supported microcontroller in `kmk/quickpin/pro_micro`:

```python
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
Expand Down
43 changes: 24 additions & 19 deletions boards/draculad/kb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import board

from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_Micro.avr_promicro import translate as avr
from kmk.quickpin.pro_micro.avr_promicro import translate as avr
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
from kmk.scanners import DiodeOrientation
# from kmk.scanners.encoder import RotaryioEncoder
Expand Down Expand Up @@ -35,35 +35,40 @@ def __init__(self):
# )
]
col_pins = (
pins[avr["F4"]],
pins[avr["F5"]],
pins[avr["F6"]],
pins[avr["F7"]],
pins[avr["B1"]],
pins[avr['F4']],
pins[avr['F5']],
pins[avr['F6']],
pins[avr['F7']],
pins[avr['B1']]
)
row_pins = (pins[avr["D4"]], pins[avr["C6"]], pins[avr["D7"]], pins[avr["E6"]])
data_pin = pins[avr["D2"]]
rgb_pixel_pin = pins[avr["D3"]]
row_pins = (
pins[avr['D4']],
pins[avr['C6']],
pins[avr['D7']],
pins[avr['E6']]
)
data_pin = pins[avr['D2']]
rgb_pixel_pin = pins[avr['D3']]
rgb_num_pixels = 20
i2c = board.I2C
SCL=pins[5]
SDA=pins[4]
pin_a1=pins[avr["B2"]]
pin_a2=pins[avr["B4"]]
pin_b1=pins[avr["B6"]]
pin_b2=pins[avr["B5"]]
pin_a1=pins[avr['B2']]
pin_a2=pins[avr['B4']]
pin_b1=pins[avr['B6']]
pin_b2=pins[avr['B5']]
led_key_pos=[
5,6,7,8,9,19,18,17,16,15,14,13,12,11,10,0,1,2,3,4
]
5, 6, 7, 8, 9, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 0, 1, 2, 3, 4
]
brightness_limit = 1.0
num_pixels = 20

# NOQA
# flake8: noqa
# fmt: off
coord_mapping = [
0, 1, 2, 3, 4, 24, 23, 22, 21, 20,
5, 6, 7, 8, 9, 29, 28, 27, 26, 25,
10, 11, 12, 13, 14, 34, 33, 32, 31, 30,
17, 18, 19, 39, 36, 35,
0, 1, 2, 3, 4, 24, 23, 22, 21, 20,
5, 6, 7, 8, 9, 29, 28, 27, 26, 25,
10, 11, 12, 13, 14, 34, 33, 32, 31, 30,
17, 18, 19, 39, 38, 37
]
92 changes: 65 additions & 27 deletions boards/draculad/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from kb import KMKKeyboard

from kmk.extensions.peg_oled_Display import (
from kmk.extensions.peg_oled_display import (
Oled,
OledData,
OledDisplayMode,
Expand All @@ -9,22 +9,64 @@
from kmk.extensions.peg_rgb_matrix import Rgb_matrix
from kmk.keys import KC
from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.modules.split import Split

keyboard = KMKKeyboard()
keyboard.debug_enable=True

modtap = ModTap()
layers_ext = Layers()
keyboard.modules.append(layers_ext)
keyboard.modules.append(modtap)
keyboard.debug_enable = True
keyboard.modules.append(Layers())
# oled
oled_ext = Oled(OledData(corner_one={0:OledReactionType.STATIC,1:["1 2 3 4 5 6","","","","","","",""]},corner_two={0:OledReactionType.STATIC,1:[" 7 8 Layer","","","","","",""," 7 8 Layer"]},corner_three={0:OledReactionType.LAYER,1:["^"," ^"," ^"," ^"," ^"," ^","",""]},corner_four={0:OledReactionType.LAYER,1:["","","","","",""," ^"," ^"]}),toDisplay=OledDisplayMode.TXT,flip= True)
oled_ext = Oled(
OledData(
corner_one={
0: OledReactionType.STATIC,
1: ['1 2 3 4 5 6', '', '', '', '', '', '', ''],
},
corner_two={
0: OledReactionType.STATIC,
1: [' 7 8 Layer', '', '', '', '', '', '', ' 7 8 Layer'],
},
corner_three={
0: OledReactionType.LAYER,
1: ['^', ' ^', ' ^', ' ^', ' ^', ' ^', '', ''],
},
corner_four={
0: OledReactionType.LAYER,
1: ['', '', '', '', '', '', ' ^', ' ^'],
},
),
toDisplay=OledDisplayMode.TXT,
flip=True,
)
# oled
keyboard.extensions.append(oled_ext)
# ledmap
rgb_ext = Rgb_matrix(ledDisplay=[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],split=True,rightSide=False,disable_auto_write=True)
rgb_ext = Rgb_matrix(
ledDisplay=[
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
[255, 255, 255],
],
split=True,
rightSide=False,
disable_auto_write=True,
)
# ledmap
keyboard.extensions.append(rgb_ext)
split = Split(use_pio=True)
Expand All @@ -37,27 +79,23 @@

keyboard.keymap = [
[ #QWERTY
KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P,\
KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN,\
KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH,\
KC.LCTL, LOWER, KC.SPC, KC.BSPC, RAISE, KC.ENT

KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P,
KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN,
KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH,
KC.LCTL, LOWER, KC.SPC, KC.BSPC, RAISE, KC.ENT,
],
[ #RAISE
KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0,\
KC.TAB, KC.LEFT, KC.DOWN, KC.UP, KC.RGHT, XXXXXXX, KC.MINS, KC.EQL, KC.LBRC, KC.RBRC,\
KC.LCTL, KC.GRV, KC.LGUI, KC.LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.BSLS, KC.QUOT,\
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX

KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0,
KC.TAB, KC.LEFT, KC.DOWN, KC.UP, KC.RGHT, XXXXXXX, KC.MINS, KC.EQL, KC.LBRC, KC.RBRC,
KC.LCTL, KC.GRV, KC.LGUI, KC.LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.BSLS, KC.QUOT,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
],
[ #LOWER
KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN,\
KC.ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.UNDS, KC.PLUS, KC.LCBR, KC.RCBR,\
KC.CAPS, KC.TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PIPE, KC.DQT,\
XXXXXXX, XXXXXXX, XXXXXXX, KC.ENT, XXXXXXX, KC.DEL


]
KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN,
KC.ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.UNDS, KC.PLUS, KC.LCBR, KC.RCBR,
KC.CAPS, KC.TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PIPE, KC.DQT,
XXXXXXX, XXXXXXX, XXXXXXX, KC.ENT, XXXXXXX, KC.DEL,
],
]

if __name__ == '__main__':
Expand Down

0 comments on commit 4801b33

Please sign in to comment.