The Adafruit QT2040 Trinkey is a compact development board that harnesses the power of the Raspberry Pi RP2040 microcontroller. This board is designed for ease of use and rapid prototyping, featuring built-in sensors and buttons. It is perfect for DIY enthusiasts and professionals looking to create interactive projects or smart devices without the need for extensive wiring or peripheral components.
Pin Number | Function | Description |
---|---|---|
1 | USB VBUS | USB input voltage (5V) |
2 | GND | Ground |
3 | NEOPIXEL DATA | Data input for the onboard NeoPixel LED |
4 | CAP TOUCH | Capacitive touch input |
5 | BOOTSEL | Boot selection button, active-low |
6 | GND | Ground |
7 | 3V3_EN | 3.3V regulator enable, active-high |
8 | 3V3_OUT | 3.3V output from the onboard voltage regulator |
Powering the Board: Connect the Adafruit QT2040 Trinkey to a computer or USB power source using a USB-C cable. The board should power up and the onboard NeoPixel LED will light up.
Programming the Board: The QT2040 Trinkey can be programmed using C/C++ SDK or MicroPython. For beginners, it is recommended to start with the Thonny IDE and MicroPython for an easier setup.
Interacting with the Capacitive Touch: The capacitive touch pad can be used as an input. It can be programmed to trigger events or actions when touched.
Using the NeoPixel LED: The onboard NeoPixel LED can be controlled to display various colors and patterns. It requires a digital signal to the NEOPIXEL DATA pin.
Utilizing the BOOTSEL Button: The BOOTSEL button is used to enter the bootloader mode for firmware updates or to reprogram the flash memory.
Q: Can I use the QT2040 Trinkey with Arduino IDE? A: The QT2040 Trinkey is not natively supported by the Arduino IDE. However, you can use the Arduino-Pico core to program the RP2040 with the Arduino IDE.
Q: How do I change the color of the NeoPixel LED? A: You can change the color of the NeoPixel LED by sending digital signals to the NEOPIXEL DATA pin. This can be done using libraries available for the RP2040, such as the Adafruit NeoPixel library for MicroPython.
Q: What is the maximum current the 3V3_OUT pin can supply? A: The 3V3_OUT pin can typically supply up to 300 mA. However, it is recommended to check the latest datasheet for the exact specifications.
#include <Adafruit_NeoPixel.h>
#define PIN 3 // NEOPIXEL DATA pin on QT2040 Trinkey
#define NUMPIXELS 1 // Number of NeoPixels
// Initialize the NeoPixel library.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // Initialize the NeoPixel strip
}
void loop() {
pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Red color
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500); // Pause for half a second
pixels.clear(); // Turn off all pixels
pixels.show();
delay(500);
}
Note: The above example is for illustrative purposes. Since the QT2040 Trinkey is not directly compatible with Arduino UNO, you would need to adapt the code for the RP2040 environment and use appropriate libraries.