-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fruitbar-R2 board. #868
base: master
Are you sure you want to change the base?
Changes from all commits
8a5df34
0b6d90c
2900dc1
d357f5f
435b6c1
4c13636
02cdd63
b9e2283
2524127
1908af7
1d606fd
ac9e154
edf2d62
825e793
e69c06a
c940323
93c1eef
138929d
5256269
92bf074
ee3bd7d
22d1da3
5047791
2913e89
ecdc026
d9832f5
d2e5b8e
ce35b0a
8b6235a
45d06c3
6e01904
dd5ad4f
1f1d932
17a7d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||||
# Fruitbar R2 | ||||||||
|
||||||||
![Fruitbar](https://volcano.newts.org/wp-content/uploads/sites/2/2023/09/image-1024x305.png) | ||||||||
|
||||||||
Fruitbar R2 with IPS Display | ||||||||
|
||||||||
0. Remove the back plate to access the boot button on the back of the board. It is the button closest to the USB. Press and hold the button, plug the board in, then release the button. You will see a RPI-RP2 drive. Drag or copy the [flash_nuke.uf2](https://cdn-learn.adafruit.com/assets/assets/000/099/419/original/flash_nuke.uf2). After a few moments the RPI-RP2 drive will reappear. | ||||||||
1. Install Circuitpython for the Solder Party Stamp board from here: https://circuitpython.org/board/solderparty_rp2040_stamp/ by dragging or copying the UF2 to the drive like the previous step. | ||||||||
2. After about 20 seconds it will reboot again and now a CIRCUITPY drive will show up. Delete the `code.py` file | ||||||||
3. Copy the `kmk` folder to the drive | ||||||||
4. Copy the two `*.py` files in the `boards/fruitbar` folder to the drive. | ||||||||
5. Use `circup` to install `adafruit_displayio_ssd1306` and `adafruit_display_text modules` for the OLED | ||||||||
6. After a few seconds you should have a keyboard! To change your options or keymaps just edit or copy new keymap.py file to the board. | ||||||||
|
||||||||
That's it! | ||||||||
|
||||||||
|
||||||||
Extensions enabled by default | ||||||||
- [Layers](/docs/en/layers.md) Need more keys than switches? Use layers. | ||||||||
|
||||||||
|
||||||||
Common Extensions | ||||||||
|
||||||||
|
||||||||
Comment on lines
+20
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||||||||
import board | ||||||||||||
|
||||||||||||
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard | ||||||||||||
# from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
from kmk.scanners import DiodeOrientation | ||||||||||||
|
||||||||||||
# needed to get GP29 when not using the adafruit board | ||||||||||||
# ph0enix designed by shockdesign & pelrun | ||||||||||||
# https://github.com/shockdesign/ph0enix-keyboard | ||||||||||||
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this? |
||||||||||||
|
||||||||||||
|
||||||||||||
class KMKKeyboard(_KMKKeyboard): | ||||||||||||
row_pins = ( | ||||||||||||
board.GP29, | ||||||||||||
board.GP18, | ||||||||||||
board.GP10, | ||||||||||||
board.GP6, | ||||||||||||
) | ||||||||||||
col_pins = ( | ||||||||||||
board.GP25, | ||||||||||||
board.GP24, | ||||||||||||
board.GP23, | ||||||||||||
board.GP22, | ||||||||||||
board.GP21, | ||||||||||||
board.GP20, | ||||||||||||
board.GP17, | ||||||||||||
board.GP16, | ||||||||||||
board.GP15, | ||||||||||||
board.GP13, | ||||||||||||
board.GP12, | ||||||||||||
board.GP11, | ||||||||||||
board.GP9, | ||||||||||||
board.GP8, | ||||||||||||
board.GP7, | ||||||||||||
board.GP3, | ||||||||||||
) | ||||||||||||
diode_orientation = DiodeOrientation.COLUMNS | ||||||||||||
rgb_num_pixels = 1 | ||||||||||||
|
||||||||||||
debug_enabled = True | ||||||||||||
|
||||||||||||
|
||||||||||||
# i2c = board.I2C | ||||||||||||
SCL = board.GP4 | ||||||||||||
SDA = board.GP5 | ||||||||||||
Comment on lines
+41
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't do anything
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,285 @@ | ||
import board | ||
|
||
from kb import KMKKeyboard | ||
|
||
from kmk.extensions.peg_oled_Display import ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We recommend you use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give it a try. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I don't know what to do here. I used peg_oled as an example and it works. If I change it, what board do you suggest to use as a model? |
||
Oled, | ||
OledData, | ||
OledDisplayMode, | ||
OledReactionType, | ||
) | ||
from kmk.keys import KC | ||
from kmk.modules.layers import Layers | ||
from kmk.scanners import DiodeOrientation | ||
|
||
keyboard = KMKKeyboard() | ||
|
||
# needed for OLED | ||
# | ||
keyboard.SCL = board.GP27 | ||
keyboard.SDA = board.GP26 | ||
|
||
Comment on lines
+19
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this not part of the keyboard class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. part of the process until I got it to work. yeeting now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I didn't chase it down but these are needed for the OLED to work. I remember when I did this a few months ago I had a hella time figuring out how to configure the OLED. Is there a better place to define it? There is no circuitpython board defined for it so I found the stamp as the most generic board to use. |
||
|
||
oled_ext = Oled( | ||
OledData( | ||
corner_one={0: OledReactionType.STATIC, 1: ['layer']}, | ||
corner_two={0: OledReactionType.LAYER, 1: ['1', '2', '3', '4']}, | ||
corner_three={ | ||
0: OledReactionType.LAYER, | ||
1: ['base', 'raise', 'lower', 'adjust'], | ||
}, | ||
corner_four={ | ||
0: OledReactionType.LAYER, | ||
1: ['qwerty', 'nums', 'shifted', 'leds'], | ||
}, | ||
), | ||
toDisplay=OledDisplayMode.TXT, | ||
flip=False, | ||
) | ||
|
||
_______ = KC.TRNS | ||
XXXXXXX = KC.NO | ||
|
||
layers = Layers() | ||
keyboard.extensions.append(oled_ext) | ||
|
||
keyboard.modules = [layers] | ||
|
||
BASE = 0 | ||
FN1 = KC.MO(1) | ||
FN2 = KC.MO(2) | ||
KC_NEXT = KC.MEDIA_NEXT_TRACK | ||
|
||
keyboard.keymap = [ | ||
# Qwerty | ||
# ,---------------------------------------------------------------------------------------------------------------. | ||
# | ESC | Q | W | E | R | T | Y | U | I | O | P | ( | ) | \ | Next| Media| | ||
# |------+------+------+------+------+------+------+------+------+------+------|------+------+------+------+------| | ||
# | Tab | A | S | D | F | G | H | J | K | L | ; | ' | Enter| | ||
# |------+------+------+------+------+-------------+------+------+------+------|------+------+------+------+------| | ||
# | Shift| Z | X | C | V | B | N | M | , | . | / | - | = | | Up | | ||
# |------+------+------+------+------+------+------+------+------+------+------|------+------+------+------+------| | ||
# | Ctrl | GUI | Alt | | Bksp | | | Space| FN1 | FN2 | | | | Left | Down | Right| | ||
# `---------------------------------------------------------------------------------------------------------------' | ||
[ | ||
KC.ESC, | ||
KC.Q, | ||
KC.W, | ||
KC.E, | ||
KC.R, | ||
KC.T, | ||
KC.Y, | ||
KC.U, | ||
KC.I, | ||
KC.O, | ||
KC.P, | ||
KC.LBRC, | ||
KC.RBRC, | ||
KC.BSLS, | ||
KC_NEXT, | ||
KC.NO, | ||
KC.TAB, | ||
KC.A, | ||
KC.S, | ||
KC.D, | ||
KC.F, | ||
KC.G, | ||
KC.H, | ||
KC.J, | ||
KC.K, | ||
KC.L, | ||
KC.SCLN, | ||
KC.QUOT, | ||
KC.ENT, | ||
KC.ENT, | ||
KC.NO, | ||
KC.NO, | ||
KC.LSFT, | ||
KC.NO, | ||
KC.Z, | ||
KC.X, | ||
KC.C, | ||
KC.V, | ||
KC.B, | ||
KC.N, | ||
KC.M, | ||
KC.COMM, | ||
KC.DOT, | ||
KC.SLSH, | ||
KC.MINS, | ||
KC.EQL, | ||
KC.UP, | ||
KC.X, | ||
KC.LCTRL, | ||
KC.LGUI, | ||
KC.LALT, | ||
KC.NO, | ||
KC.BSPC, | ||
KC.NO, | ||
KC.NO, | ||
KC.SPC, | ||
KC.NO, | ||
FN1, | ||
FN2, | ||
KC.NO, | ||
KC.NO, | ||
KC.LEFT, | ||
KC.DOWN, | ||
KC.RGHT, | ||
], | ||
# Alt | ||
# ,---------------------------------------------------------------------------------------------------------------. | ||
# | Grave| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | | | ||
# |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
# | Trans| ! | @ | # | $ | % | ^ | & | * | = | - | | | | | | | ||
# |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------+------| | ||
# | Trans| { | [ | ( | _ | ) | ] | } | | ; | ` | | | | Pg Up| | | ||
# |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
# | Trans| Trans| Trans| Trans| Del | Trans| \ | | | | | | | Home | Pg Dn| End | | ||
# `---------------------------------------------------------------------------------------------------------------' | ||
[ | ||
KC.GRV, | ||
KC.N1, | ||
KC.N2, | ||
KC.N3, | ||
KC.N4, | ||
KC.N5, | ||
KC.N6, | ||
KC.N7, | ||
KC.N8, | ||
KC.N9, | ||
KC.N0, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.EXLM, | ||
KC.AT, | ||
KC.HASH, | ||
KC.DLR, | ||
KC.PERC, | ||
KC.CIRC, | ||
KC.AMPR, | ||
KC.ASTR, | ||
KC.EQL, | ||
KC.MINS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.LCBR, | ||
KC.LBRC, | ||
KC.LPRN, | ||
KC.UNDS, | ||
KC.RPRN, | ||
KC.RBRC, | ||
KC.RCBR, | ||
KC.NO, | ||
KC.SCLN, | ||
KC.QUOT, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.PGUP, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.DEL, | ||
KC.TRNS, | ||
KC.BSLS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.HOME, | ||
KC.PGDN, | ||
KC.END, | ||
], | ||
# Alt 2 | ||
# ,---------------------------------------------------------------------------------------------------------------. | ||
# | Trans| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | | | | | | ||
# |------+------+------+------+------+------+------+------+------+------+------|------+------+------+------+------| | ||
# | Trans| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | | | ||
# |------+------+------+------+------+-------------+------+------+------+------|------+------+------+------+------| | ||
# | Trans| F2 | F4 | F6 | F8 | F10 | F12 | = | ( | Pg Up| ) | | | | | | | ||
# |------+------+------+------+------+------+------+------+------+------+------|------+------+------+------+------| | ||
# | Trans| Trans| Trans| Trans| Trans| Trans| \ | Home | Pg Dn| End | Del | | | | | | | ||
# `---------------------------------------------------------------------------------------------------------------' | ||
[ | ||
KC.TRNS, | ||
KC.F1, | ||
KC.F2, | ||
KC.F3, | ||
KC.F4, | ||
KC.F5, | ||
KC.F6, | ||
KC.F7, | ||
KC.F8, | ||
KC.F9, | ||
KC.F10, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.GRV, | ||
KC.N1, | ||
KC.N2, | ||
KC.N3, | ||
KC.N4, | ||
KC.N5, | ||
KC.N6, | ||
KC.N7, | ||
KC.N8, | ||
KC.N9, | ||
KC.N0, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.F2, | ||
KC.F4, | ||
KC.F6, | ||
KC.N8, | ||
KC.F10, | ||
KC.F12, | ||
KC.EQL, | ||
KC.LBRC, | ||
KC.PGUP, | ||
KC.RBRC, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.BSLS, | ||
KC.HOME, | ||
KC.PGDN, | ||
KC.END, | ||
KC.DEL, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
KC.TRNS, | ||
], | ||
] | ||
|
||
if __name__ == '__main__': | ||
keyboard.go() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.