The Adafruit NeoKey Trinkey is a compact, programmable mechanical keyboard module that offers a unique combination of user input and colorful feedback. It features a 12-key layout with individually addressable NeoPixel RGB LEDs under each key, making it an ideal choice for DIY enthusiasts who want to create custom keyboards, macro pads, or interactive input devices for their projects. The NeoKey Trinkey can be used in various applications, including gaming, music production, and custom control interfaces for software or hardware.
Pin Number | Description |
---|---|
1 | NeoPixel Data Input |
2 | Key 1 Input |
3 | Key 2 Input |
4 | Key 3 Input |
5 | Key 4 Input |
6 | Key 5 Input |
7 | Key 6 Input |
8 | Key 7 Input |
9 | Key 8 Input |
10 | Key 9 Input |
11 | Key 10 Input |
12 | Key 11 Input |
13 | Key 12 Input |
GND | Ground |
VBUS | USB Power (5V) |
RESET | Reset Pin (active low) |
To use the Adafruit NeoKey Trinkey in a circuit:
Here is a simple example code snippet for the Arduino UNO that initializes the NeoPixel LEDs and sets them to a color when a key is pressed:
#include <Adafruit_NeoPixel.h>
#define PIN_NEOPIXEL 6 // NeoPixel data input pin
#define NUMPIXELS 12 // Number of NeoPixels
Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // Initialize the NeoPixel strip
}
void loop() {
for (int i = 0; i < NUMPIXELS; i++) {
// Check if key i is pressed
if (digitalRead(i + 2) == LOW) { // Key pins start at pin 2
pixels.setPixelColor(i, pixels.Color(0, 150, 0)); // Set color to green
} else {
pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Turn off pixel
}
}
pixels.show(); // Update the strip with new colors
}
Remember to install the Adafruit_NeoPixel
library before uploading this code to your Arduino UNO.
Q: Can I use the NeoKey Trinkey with a battery? A: Yes, as long as the battery can provide a stable 5V output.
Q: How do I change the color of the NeoPixels?
A: Use the pixels.setPixelColor(index, pixels.Color(red, green, blue));
function in your code, where index
is the pixel number and red
, green
, blue
are the color values.
Q: What is the maximum number of NeoKey Trinkeys I can chain together? A: Theoretically, you can chain multiple modules as long as the total current draw does not exceed the USB port's limit. However, you will need to manage the data lines and modify the code accordingly.
For further assistance, consult the Adafruit NeoKey Trinkey forums and support channels.