Skip to content

Instantly share code, notes, and snippets.

@b2ox
b2ox / CoinCase6P.md
Created May 6, 2024 13:53
カードサイズのコインケース

coincase

@b2ox
b2ox / REnc.py
Last active April 26, 2024 02:16
Simple Rotary Encoder Module for #kmk_firmware
# Simple Rotary Encoder Module
import rotaryio
from kmk.modules import Module
class REnc(Module):
def __init__(
self,
pinA,
pinB,
up = None,
@b2ox
b2ox / singlekey.py
Last active October 10, 2023 10:39
SingleKey module for #kmk_firmware
from digitalio import DigitalInOut, Direction, Pull
from kmk.modules import Module
class SingleKey(Module):
def __init__(self, pin, key, flip_logic = False):
self.flip_logic = flip_logic
port = DigitalInOut(pin)
port.direction = Direction.INPUT
port.pull = Pull.UP if flip_logic else Pull.DOWN
self.port = port
@b2ox
b2ox / tracball.md
Last active April 17, 2023 22:39
#自作トラックボール 用 ベアリング支持台座

34mm球版 image

25mm球版 image

11mm球版 image

@b2ox
b2ox / adns2610.py
Last active October 10, 2023 10:41
ADNS-2610互換品を使ったポインティングデバイスモジュール for #kmk_firmware #自作キーボード
import busio
import microcontroller
import math
from supervisor import ticks_ms
from kmk.keys import AX
from kmk.modules import Module
# convert from given 1 byte raw value to int value
def s8(value):
@b2ox
b2ox / StickMouse.py
Last active October 5, 2023 15:36
Analog Joystick as a mouse module for #kmk_firmware
import board
from digitalio import DigitalInOut, Direction, Pull
from supervisor import ticks_ms
from analogio import AnalogIn
from kmk.modules import Module
from kmk.keys import AX, KC
from kmk.kmktime import PeriodicTimer
class StickMouse(Module):
'''Module handles usage of Analog stick'''
@b2ox
b2ox / mk25.scad
Created October 20, 2022 20:44
mini.keeb.25
UnitOuter = 16;
UnitInner = 14;
module holeM3(x, y, h) {
translate([x, y, 0]) cylinder(h = h, d = 3.2, center = true, $fn = 20);
}
module KeyHole(x, y, w, h) {
translate([x, y, 0])
cube([w, w, h], center = true);
@b2ox
b2ox / keycap.md
Last active March 7, 2023 01:23
Keycap and tilting unit

image

@b2ox
b2ox / code.py
Created September 5, 2022 21:10
cool640 x 2 split keyboard wtth kmk firmware
from kmk.hid import HIDModes
from cool640 import KMKKeyboard
if __name__ == '__main__':
try:
keeb = KMKKeyboard()
keeb.debug_enabled = True
keeb.go(hid_type=HIDModes.USB) #Wired USB enable
except OSError:
import supervisor
@b2ox
b2ox / NPXStatus.py
Last active April 7, 2023 00:01
Neopixel indicator module for kmk firmware
import time
#import neopixel
from pioasm_neopixel_bg import NeoPixelBackground
# https://learn.adafruit.com/intro-to-rp2040-pio-with-circuitpython/advanced-using-pio-to-drive-neopixels-in-the-background
from kmk.modules import Module, InvalidExtensionEnvironment
from kmk.keys import ModifierKey
class NPXStatus(Module):