Coder Social home page Coder Social logo

kappa-pad's Introduction

KappaPad

KappaPad is a two-button keypad intended for playing osu!. Unlike other keypads with mechanical switches, KappaPad has fixed metal pads and uses capacitive sensing to determine when they are being pressed. Because there is no key travel, one can minimize the distance their fingers move to conserve stamina during long streams.

KappaPad

Usage

Just plug the KappaPad into a computer, and it should work as a USB keyboard, with the keys bound to Z and X. (The key bindings can be changed in the Arduino sketch.)

How to Make One

There aren't any plans to sell these yet, but it is fairly simple to build your own. Here is an example of how to build one, but you don't have to follow it exactly. Just use the materials you have on hand.

Physical Construction

The base should ideally be heavy and have a non-slip surface on the bottom. The keypad pictured has a base made out of 3/8 inch (~1cm) acrylic, with rubber feet on the bottom. Components were attached with double-sided foam tape.

Electronics

Closeup of Electronics

Components Used

  • 170 Point Breadboard
  • Clone of Arduino Pro Micro
  • 2x 100 Ohm Resistor
  • 1x 220 Ohm Resistor
  • 2x 330 kOhm Resistor
  • Solid-Core Wire
  • Common-Cathode RGB LED

All of the electronics were connected by a small breadboard. An Arduino Pro Micro-compatible board was used as the microcontroller. Other boards that can act as a USB keyboard can be used, such as Arduino Leonardo, Arduino Zero, Arduino Due, and Teensy. The optional LED will light up red or green depending on which key was pressed. It was mounted pointing downwards in a hole in the acrylic base to provide illumination all around the edges.

The keys were made out of sheet aluminum, with wires crimped to provide a secure electrical connection. Any metal objects can be used for the keys. The size and material of the objects will determine the treshold values when calibrating the keyboard.

Software

The Arduino Sketch is located in the KappaPad directory of this repository. It requires the CapacitiveSensor library so install that first.

Make sure the correct pin numbers are given where the CapacitiveKey classes are initialized, and make sure the disable pin (15 by default) is accessible on your board.

Upload the sketch to the board using the appropriate board type. (Use Arduino Leonardo if you have a Pro Micro.) After uploading, note that your board may recieve a different serial port number.

At this point the keyboard may work, or the treshold values may have to be adjusted. If keys act like they are being held down and your computer is now unusable when the keypad is plugged in, connect a wire from the disable pin to ground to stop keypresses from being sent. If the keys do not work, uncomment the #DEFINE SERIAL_OUTPUT and reupload the sketch. Now, when you open the Arduino serial monitor (at 115200 baud) you should see the sensed capacitance for each key. Change the tresholds so that they are just above the largest values you see when not touching the keys, and reupload the sketch. Once you are satisfied with the operation of the keyboard, disable serial output again to improve performance.

kappa-pad's People

Contributors

fb39ca4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kappa-pad's Issues

x is sometimes doubled

if i press the pad for X the arduino sometimes taps it double
-> im using 2x 10kOhm resistors - maybe that will make a diffrence ??

Can't Compile

I am using an Arduino lenonardo and when i compile the sketch, it gives me and error:
Arduino: 1.9.0-beta (Windows 10), Board: "Arduino Leonardo"

Build options changed, rebuilding all
C:\Users\kevin\AppData\Local\Temp\ccMDCXOx.ltrans0.ltrans.o: In function `CapacitiveKey::keyUpdate(bool)':

sketch/CapacitiveKey.h:23: undefined reference to `CapacitiveSensor::capacitiveSensorRaw(unsigned char)'

C:\Users\kevin\AppData\Local\Temp\ccMDCXOx.ltrans1.ltrans.o: In function `__base_ctor ':

sketch/CapacitiveKey.h:13: undefined reference to `CapacitiveSensor::CapacitiveSensor(unsigned char, unsigned char)'

sketch/CapacitiveKey.h:13: undefined reference to `CapacitiveSensor::CapacitiveSensor(unsigned char, unsigned char)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Leonardo.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

x being held down.

i have tried to set the Serial.begin(115200) to multiple numbers, without touching anything the value 65534,65534
i tried 0, 100, 20000, 300000, 65000,64000 and much more
the x or z keeps getting held down. When i touch the wire it dips (depending on the pin) a lot for example 3712,65534 or 65534,2514.
I just dont understand why it keeps spamming x or z.
please help im making this for a friend and his birthday is coming up. Im going to 3d pint an enclosure for this.

#include "capacativeKey" --> #include "CapacativeKey"

As implied by the title, there is a case mismatch between the #include statement and the filename of the CapacativeKey header.

Another less severe issue is your use of "treshold", correctly spelled "threshold."

"'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?"

Soooo, been experiencing this now
Here's the error message

`
Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

D:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\jaredo-kun\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156 -warnings=none -build-cache C:\Users\JAREDO1\AppData\Local\Temp\arduino_cache_753850 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\Arduino\hardware\tools\avr -verbose D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino

D:\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\jaredo-kun\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries C:\Users\jaredo-kun\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156 -warnings=none -build-cache C:\Users\JAREDO1\AppData\Local\Temp\arduino_cache_753850 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=D:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\Arduino\hardware\tools\avr -verbose D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino

Using board 'uno' from platform in folder: D:\Arduino\hardware\arduino\avr

Using core 'arduino' from platform in folder: D:\Arduino\hardware\arduino\avr

Detecting libraries used...

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for Keyboard.h: [[email protected]]

ResolveLibrary(Keyboard.h)

-> candidates: [[email protected]]

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for HID.h: [[email protected]]

ResolveLibrary(HID.h)

-> candidates: [[email protected]]

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Using cached library dependencies for file: C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\CapacitiveSensor.cpp

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "D:\Arduino\libraries\Keyboard\src\Keyboard.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "D:\Arduino\hardware\arduino\avr\libraries\HID\src\HID.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\preproc\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"D:\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

Using previously compiled file: C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\CapacitiveSensor.cpp.o

"D:\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "-ID:\Arduino\libraries\Keyboard\src" "-ID:\Arduino\hardware\arduino\avr\libraries\HID\src" "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp" -o "C:\Users\JAREDO1\AppData\Local\Temp\arduino_build_345156\sketch\KappaPad.ino.cpp.o"

In file included from D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:6:0:

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h: In member function 'void CapacitiveKey::keyUpdate(bool)':

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h:27:31: error: 'Keyboard' was not declared in this scope

       if (keyboardActive) Keyboard.press(key);

                           ^~~~~~~~

C:\Users\JAREDO~1\AppData\Local\Temp\arduino_build_345156\sketch\capacitiveKey.h:36:13: error: 'Keyboard' was not declared in this scope

         Keyboard.release(key);

         ^~~~~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino: In function 'void setup()':

KappaPad:15:3: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

Keyboard.begin();

^~~~~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\CapacitiveSensorSketch.ino: In function 'void setup()':

CapacitiveSensorSketch:16:6: error: redefinition of 'void setup()'

void setup()

  ^~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:11:6: note: 'void setup()' previously defined here

void setup() {

  ^~~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\CapacitiveSensorSketch.ino: In function 'void loop()':

CapacitiveSensorSketch:22:6: error: redefinition of 'void loop()'

void loop()

  ^~~~

D:\Arduino\mi progarms\kappa-pad-master\KappaPad\KappaPad.ino:36:6: note: 'void loop()' previously defined here

void loop() {

  ^~~~

Using library Keyboard at version 1.0.2 in folder: D:\Arduino\libraries\Keyboard

Using library HID at version 1.0 in folder: D:\Arduino\hardware\arduino\avr\libraries\HID

exit status 1

'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

`

ccc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.