RP2040-Keyboard-3 是一款微雪 (Waveshare) 设计的高性能、高性价比的三键键盘开发板,可编程自定义按键功能与RGB灯效,
双Type-C接口,免驱动即插即用,采用热插拔工艺,可自行更换轴体,配有无字符的双层黑色键帽可自行替换。
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
注意:如果您已经有ESP32板URL,您可以使用逗号分隔 URL,如下所示:
https://dl.espressif.com/dl/package_esp32_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
C:\Users\[username]\AppData\Local\Arduino15\packages
本程序需要安装 FastLED 库使用,具体安装步骤如下:
初始化
void setup() {
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
pinMode(25, OUTPUT);
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
Keyboard.begin();
}
主循环
void loop() {
...
if(digitalRead(12) == LOW){
Keyboard.press('v');
for(int i = 0;i <= 2;i++){
leds[i] = CRGB(255,0,0);
FastLED.show();
delay(5);
}
}else{
Keyboard.release('v');
}
...
}
RP2040-Keyboard-3支持自定义按键功能,下面介绍修改按键功能的具体步骤: