Usage Instructions
The TWI Keyboard It works both with 5V and 3.3V systems (note that maximum LED brightness will be lower on 3.3V compared to 5V).
To use with an Arduino or a board compatible with the Arduino IDE, there is an Arduino library available. It is implemented using the Wire library, and should work with any Arduino.
A low-level avr-gcc library is also available, and should work on ATMega chips that have an on-board hardware TWI bus. (ATTiny chips are not supported at this time, as they do not have TWI hardware).
If your processor is not directly supported, you can interface with the chip directly using its TWI protocol.
Arduino
If you already have the Arduino IDE installed, you can download theAkafugu Arduino Libraries Package. If not, go to the
Downloads and get the IDE with all packages included.
Connect VCC to 5V on the Arduno, and GND to one of the GND pins.
SDA and SCL are in different places depending on the type of Arduino you are using: On a normal Arduino, such as the Arduino UNO, SCL connects to A5, and SDA connects to A4.
On an Arduino Mega, SCL is port 21 and SDA is port 20.
Open your Arduino IDE, and select File -> Examples -> TWIKeyboard -> simple.
Make sure the settings in the IDE match the Arduino you are using, and then press the Upload botton.
When the upload is complete, you should see LED 1 turn on and LED 2 pulsate.
Press the "Serial Monitor" button. Now you should see messages printed whenever you press, hold and release a button.
Serial and ISP Breadboard Adapter
To connect the TWI Keyboard to the Akafugu Serial and ISP Breadboard Adapter, plug in VCC and GND to pin 6 and 8 respectively. They are marked on the PCB. SDA goes to pin 27, marked A4/SDA on the PCB. SCL goes to pin 28, marked A4/SCL on the PCB.
Open the Arduino IDE: In Tools -> Board, select the following
If you have an 16MHz Serial and ISP Breadboard Adapter (with a 16MHz crystal plugged in to the breadboard): Select "Akafugu Breadboard Adapter (External 16MHz Clock)"
If you have a 8MHz Serial and ISP Breadboard Adapter: Select "Akafugu Breadboard Adapter (Internal 8MHz Clock)"
Open your Arduino IDE, and select File -> Examples -> TWIKeyboard -> simple.
Make sure the settings in the IDE match the Arduino you are using, and then press the Upload botton.
When the upload is complete, you should see LED 1 turn on and LED 2 pulsate.
Press the "Serial Monitor" button. Now you should see messages printed whenever you press, hold and release a button.
avr-gcc
See avr-gcc Installation Instructions instructions](/resources/avr-gcc/) for how to install the avr-gcc toolchain.
To install, use the following commands:
make
make flash