Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit Rotary Trinkey: Examples, Pinouts, and Specs

Image of Adafruit Rotary TrinkeyDesign with Adafruit Rotary Trinkey in Cirkit Designer

Introduction

The Adafruit Rotary Trinkey is a compact and versatile microcontroller board designed for user input and feedback in various electronic projects. It integrates a rotary encoder, an RGB NeoPixel, and a USB-C connector, making it an ideal choice for adding a controllable interface to your projects. The board is based on the Adafruit Trinkey platform and supports programming with CircuitPython or Arduino, offering flexibility for both beginners and experienced developers.

Explore Projects Built with Adafruit Rotary Trinkey

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Leonardo-Based Gaming Steering Wheel with Pedals and Gear Shifter: A project utilizing Adafruit Rotary Trinkey in a practical application
Arduino Leonardo-Based Gaming Steering Wheel with Pedals and Gear Shifter

This circuit is a gaming steering wheel system with 3 pedals and a gear shifter, interfaced with an Arduino Leonardo. It includes a 600 PPR optical rotary encoder for steering, three potentiometers for pedal input, and multiple push buttons connected via an IO expander for gear shifting and additional controls. The Arduino processes inputs from these components and communicates the data for further processing or display.

Open Project in Cirkit Designer
Image of Arduino Nano Controlled Joystick and Rotary Encoder Interface with OLED Display and Multi-Color LED Feedback: A project utilizing Adafruit Rotary Trinkey in a practical application
Arduino Nano Controlled Joystick and Rotary Encoder Interface with OLED Display and Multi-Color LED Feedback

This circuit features an Arduino Nano interfaced with a joystick module, a rotary encoder, an OLED display, and multiple LEDs with current-limiting resistors. The joystick controls the selection of LED colors and toggles a blinking mode, while the rotary encoder adjusts the brightness of the LEDs and toggles their on/off state. The OLED display provides real-time feedback on the LED color, brightness level, and mode, enhancing user interaction.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Description Notes
1 NeoPixel Data Control signal for RGB NeoPixel
2 Rotary Encoder A Encoder signal A
3 Rotary Encoder B Encoder signal B
4 Rotary Encoder Button Push button switch
5 Analog/Digital I/O Can be used as GPIO or ADC
USB-C Power and Data Connects to USB host

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Device:

    • Connect the Adafruit Rotary Trinkey to a USB-C power source. The device is powered through the USB-C connection.
  2. Interfacing with the Rotary Encoder:

    • The rotary encoder outputs two square wave signals, A and B, which are 90 degrees out of phase. By monitoring these signals, you can determine the direction and amount of rotation.
  3. Controlling the NeoPixel:

    • The onboard NeoPixel can be controlled via the NeoPixel Data pin. You can set the color and brightness using appropriate libraries in CircuitPython or Arduino.
  4. Programming the Device:

    • The Adafruit Rotary Trinkey can be programmed using CircuitPython or Arduino. For CircuitPython, simply drag and drop the .uf2 file onto the board when it appears as a USB drive. For Arduino, select the appropriate board and port in the Arduino IDE and upload your sketch.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Adafruit_NeoPixel.h>

#define NEOPIXEL_PIN 1 // Replace with the correct pin number for NeoPixel
#define ENCODER_PIN_A 2 // Replace with the correct pin number for Encoder A
#define ENCODER_PIN_B 3 // Replace with the correct pin number for Encoder B
#define BUTTON_PIN 4 // Replace with the correct pin number for Button

Adafruit_NeoPixel pixel(1, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pinMode(ENCODER_PIN_A, INPUT_PULLUP);
  pinMode(ENCODER_PIN_B, INPUT_PULLUP);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pixel.begin();
  pixel.show(); // Initialize all pixels to 'off'
}

void loop() {
  // Add your code here to read the rotary encoder and button
  // and control the NeoPixel.
}

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I use the Adafruit Rotary Trinkey with a battery? A: Yes, but you will need to ensure the battery's output is regulated to 5V and connect it through the USB-C port.

Q: How do I change the color of the NeoPixel? A: You can change the color by sending RGB values to the NeoPixel using the appropriate library functions in your code.

Q: What should I do if the device is not recognized by my computer? A: Try using a different USB cable or port, and ensure that the Trinkey is not in bootloader mode unless you are uploading new firmware.