This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Rotary Encoder Module | |
import rotaryio | |
from kmk.modules import Module | |
class REnc(Module): | |
def __init__( | |
self, | |
pinA, | |
pinB, | |
up = None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
NewerOlder