The PS/2 protocol is fairly straightforward, and the Arduino Micro is easily capable of running a bitbang implementation of the host side. We could also implement this with interrupts if we wanted to, but it is not necessary for this project.
For this project I decided to lean on the excellent TMK Keyboard Firmware. It has a ton a great features - multi-layer key maps, mouse keys, consumer keys, function callbacks for key presses, and more. Only one "problem" - it is written in AVR C with a Makefile based build, and I wanted to use the Arduino IDE to build and load the firmware. So I ported the tmk_keyboard project to the Arduino platform as a library, and creatively named it arduino_tmk_keyboard.
Click the button below to download the library as a zip file.
For this project I decided to lean on the excellent TMK Keyboard Firmware. It has a ton a great features - multi-layer key maps, mouse keys, consumer keys, function callbacks for key presses, and more. Only one "problem" - it is written in AVR C with a Makefile based build, and I wanted to use the Arduino IDE to build and load the firmware. So I ported the tmk_keyboard project to the Arduino platform as a library, and creatively named it arduino_tmk_keyboard.
Click the button below to download the library as a zip file.
First, hit the button above to download a zip of the Arduino library. Unzip it into your sketchbook's "libraries" folder:
Next, fire up the Arduino IDE and open the 'terminal_bluefruit_converter' example sketch.
The example will open and you'll see four tabs:
- terminal_bluefruit_converter - this is your main sketch, and probably the only place where you'll need to make any actual code changes. The bootstrapping of the firmware and any custom functions are defined here, and your keymaps are configured in this file as well.
- config.h - this is the main configuration file; it is included at the top all other code files so it is a great place to define macros, as well as quickly enable and disable features including debug messages
- include_api.cpp - this is a hack to properly pull in the library's API classes. Don't touch this file.
- include_tmk_.c - this is another hack to pull in the C code from the TMK firmware. Don't touch this either.
Page last edited February 20, 2014
Text editor powered by tinymce.