|
KittenBot AgileWhisker KeyboardKittenBot
|
x 1 | |
|
KittenBot Jacdac ModulesKittenBot
|
x 1 |
AgileWhisker Keyboard - A fully programmable, expandable, open-source keyboard designed for creativity
The keyboard for DeviceScript is a fully programmable and expandable keyboard based on RP2040. It allows you to enhance your desktop-level interaction experience and create a creative atmosphere by connecting various electronic modules (Jacdac). With this keyboard, you can customize its functions, create a gesture-controlled gaming device, a mailbox that automatically raises to remind you of incoming mail, or even integrate your keyboard and connected external modules into MQTT. We aim to bring DeviceScript, a technology full of potential, into your creative life, allowing TypeScript developers to experience the exciting transformation from software to controlling hardware devices. We will keep you updated with a series of articles on applications and fun creations related to the keyboard project. Stay tuned for more exciting updates!
Why AgileWhisker?
We believe the best application of DeviceScript is for PC peripherals. Have you ever imagined being able to control everything around you with the keyboard in front of your computer?
We aim to allow software engineers unfamiliar with hardware development to quickly master the skills of writing interactive effects to meet their personal needs and interests.
I try to tell you its creation process using a simple case~
Getting Started with VSCode and DeviceScript
1.First, we will need to install the necessary DeviceScript extension in VSCode.
2.Create a new project and open it (or you can also start with our demo project).
3.After connecting the keyboard using USB, connect the device in the project.
Sample - The Leaping Colorful 'Sprite'
The flowing colorful lights of a mechanical keyboard are vibrant, but their display modes are limited. With TypeScript editing, we can completely customize a set of flashing combinations that we like. In the following example, we will create a simple RGB that lights up randomly following a key press.
1.In our project, write the program in the .ts file (you can give the this file a more intuitive name). First, import the core libraries we need to use.
import { KeyboardClient, LedStripLightType, LedVariant, gpio } from "@devicescript/core";
import { startLed } from "@devicescript/drivers";
import { hid2idx } from "./utils/ledmap";
//Init the LED light inside the keyboard
const led = await startLed({
length: 13*5,
columns: 5,
variant: LedVariant.Strip,
hwConfig: { type: LedStripLightType.WS2812B_GRB, pin: gpio(7) },
})
await led.showAll(0) //0:lights off state, set all lights off
//Initialize keyboard
const kb = new KeyboardClient()
//Get pixels buffer
const pixels = await led.buffer()
//Used to store the last lit position
let lastLightNum = 0
//Used to store the last automatic light-off event
let lastClearLight: number = null
2.get the keys position through the HidKeyboard class in the core library.
//Monitor the key press event, long press will always trigger
kb.down.subscribe(async (key) => {
//hid2idx[key]:The position of the pressed button
if (hid2idx[key]) {
//code
}
})
3.Complete the code.
//Monitor the key press event, long press will always trigger
kb.down.subscribe(async (key) => {
//hid2idx[key]:The position of the pressed button
if (hid2idx[key]) {
if(lastClearLight && lastLightNum===hid2idx[key]){
//If press and hold the button, the light-off event will be cleared.
clearTimeout(lastClearLight)
}else{
let lastLight = hid2idx[key]
//Set the color of the pressed button to red
pixels.setAt(hid2idx[key], getRandomColor())
// advanced: Set the color to a random color
// pixels.setAt(hid2idx[key], getRandomColor())
await led.show();
}
//Set automatic light-off event
lastClearLight = setTimeout(async()=>{
pixels.setAt(hid2idx[key], 0)
await led.show();
lastClearLight = null
},400)
}
})
4.Just click Run to solidify your program effects into the keyboard.
More Interesting
We are crowdfunding on the CrowdSupply , if you are interested please subscribe to us!
Open Source&Community
- Project Website&Learn: https://w.kittenbot.cc (The latest news will be displayed on the website, please stay tuned.)
- Project demo repo: https://github.com/KittenBot/devs-keyboard
- Agent App: https://github.com/KittenBot/agilewhisker-desktop (Provide script services based on JavaScript or Python, or customize functions)
AgileWhisker Keyboard - A fully programmable, expandable, open-source keyboard designed for creativity
- Comments(0)
- Likes(2)
- Andrew Brady Dec 14,2024
- Engineer Oct 01,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Hogan Lee
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
71 0 0 -
DIY Laser Power Meter with Arduino
83 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
120 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
413 0 1 -
Custom Mechanic Keyboard - STM32
239 0 3