Coder Social home page Coder Social logo

joyist2021 / keypad10 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from biasedlogic/keypad10

0.0 0.0 0.0 2.42 MB

A simple external keypad based on Arduino Micro Pro / ATMega32u4, emulates HID Keyboard and is intended to use with Open Broadcaster Studio (OBS)

License: GNU General Public License v3.0

C++ 100.00%

keypad10's Introduction

Keypad10

A simple external keypad based on Arduino Micro Pro / ATMega32u4, emulates HID Keyboard and is intended to use with Open Broadcaster Studio (OBS).

Photo of the keypad

What does it do?

It emulates an external keyboard with keys not found normally on keyboards: F13-F22. The idea was to bind OBS macros/hotkeys to keys that cannot possibly be used by any real - even if totally obscure - software running on the PC. So this keypad does not need any special driver, it emulates HID Keyboard, plug and play, and then you have 10 extra keys that you know won't be already bound to something.

The keypad has freely configurable key options:

  1. There's your ordinary simple button. You press it, it sends a key pressed event, you release it, it sends key released event. It can be used for gaming as well as for any other purpose. The key LED lights up when you press it and goes dark as soon as you release it.
  2. There'e a radio-button-group mode, where some keys e.g. switch scenes or weapons. While they still act on keyboard level just as any key would, their LED stays on until you press another key from the same group, so that you know which option/scene/weapon you selected last.
  3. Then there's a toggle key. You press it once, it sends e.g. F13 keypress followed immediately by key release and its LED lights up. You press it again, it will send CTRL-F13 (if it was the F13 key) and release it immediately, also extinguishing its LED. So you can bind the two key combinations to an action activating something and then deactivating it and have the LED indicate present state reliably. You can e.g. start/stop streaming or recording that way. While OBS can use same key as a toggle between start/stop you can't tell blindly whether it started or stopped on the last hotkey press. This way you are sure.

The code allows for up as many switches and LEDs as you want, as long as you don't run out of pins. The reference hardware is anr Arduino Pro Micro and the limit is at 11 buttons with 12 LEDs (11 + 3 + 4 = 18 pins), since the code reads buttons directly (1 button = 1 pin) and only LED output is multiplexed.

Theoretically you could raise that number to 20/20 by multiplexing both, keys and LEDs, but that will need changes in code and I didn't need it.

Default configuration is: first four keys (in my pack that's a single top key and a first row of three) are toggles, then the next 6 keys are single radio group for scene switching.

Components

For my implementation I used:

  • 1x Arduino Pro Micro (ATMega 32u4) board
  • 10x Cherry MX switches of your choice (LED option) or compatible mechanically
  • 12x 3mm LEDs in color of your choice
  • 3 universal screws 9mm long, 3.5mm diameter, flat head
  • Some wire, solder, etc.

Arduino code is provided. STL files for a housing to hold 10 MX switches and an Arduino board as well.

You can see how this version works in this video:

Video demo of the Keypad10

Update - RGB version

Photo of the RGB version

This is using RGB LEDs WS2812B-MINI under the keys. Schematic is in the directory with the code (keypad10rgb), the code is documented with some comments and can be easily modified for a different pinning and/or keycount.

I have designed a slightly different housing and a PCB to mount it all, if there's interest I can provide the PCBs as well as housings at a reasonable price. I don't have the intent to release this version's hardware design to the public, if you need a free turnkey solution - use the "old" version, with single-color LEDs, it's perfectly functional and can be easily built without ordering PCBs. The RGB LEDs require PCB to work.

You can see how it all works in the following video:

Video demo of the Keypad10rgb

keypad10's People

Contributors

biasedlogic avatar

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.