Skip to content
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

[BUG] Analog module does not work #1062

Open
doman18 opened this issue Dec 22, 2024 · 1 comment
Open

[BUG] Analog module does not work #1062

doman18 opened this issue Dec 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@doman18
Copy link

doman18 commented Dec 22, 2024

My goal is to create gaming keypad with joystick and 26 keys similar to Razer Tartarus, Hori TAC, Azeron Cyborg, Saitek PZ31a etc. Im using Pi Pico (for prototyping) and later will use Pi Zero.

Im following this
https://github.com/LennartEd/Analog-WASD-Keyboard-kmk-pi-pico-rp2040/blob/main/README.md

I want to use my joystick the same way author did - by assigning WASD to it.
I adjusted my code so it looks like this:

import board

from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.scanners import DiodeOrientation
from kmk.modules.layers import Layers
from kmk.modules.analog import AnalogKey #handles analoginput

keyboard = KMKKeyboard()
layers = Layers()
ana = AnalogKey()

keyboard.modules = [layers,ana]

keyboard.col_pins = (board.GP18,board.GP19)
keyboard.row_pins = (board.GP12,board.GP13)
keyboard.diode_orientation = DiodeOrientation.COL2ROW

keyboard.keymap = [
    [
        KC.A, KC.B,
        KC.C, KC.D,
    ]
]

#ANALOG 
ana.pins = (board.A0,board.A1) #define analog pins

ana.reverse = False #flips direction(standard is: analog value goes down when key pressed) 

# define per layer if keypresses should be Threshhold(0) or Rapid trigger(1) explanation: https://wooting.io/rapid-trigger 
ana.keypType = (1,1)

#threshold: when analog value is passed key is pressed 
#rapit: when a certain distance is surpaced key is pressed (the lower the value the faster responce but at a certain point noise can trigger keypress)
    #use the provided "maxChangeInVal.py"+ 300 to find a good rapid trigger value
ana.threshold = (30000,1800) #default (30000,1800) 

ana.map = [
    [
        KC.W,KC.A,KC.S,KC.D
    ]
]

if __name__ == '__main__':
    keyboard.go()

Unfortunately im geting an error:

code.py output:
Starting
Traceback (most recent call last):
  File "code.py", line 9, in <module>
ImportError: no module named 'kmk.modules.analog'

Is there other way to achieve what i want?

@doman18 doman18 added the bug Something isn't working label Dec 22, 2024
@xs5871
Copy link
Collaborator

xs5871 commented Dec 22, 2024

This isn't a bug. The draft PR that implements that module isn't merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants