Thnikk wrote:
Deimos wrote:
1x Adafruit Trinket - Mini Mircocontroller - 5V Logic
1x mini USB cable
2x MX cherry keys
2x Keycaps
2x LEDs
1x suitable case
?x some wire
and some amateurish program skills
That is a beautiful case
Could you help me with my code for the trinket? I'm as far down on the novice scale as it gets. This is my first day with a microcontroller (and any real programming, for that matter.)
I'm using the print function, which works, but obviously not well for osu as it just registers the key being pressed a lot instead of being held down. I've also tried using TrinketKeyboard.pressKey but it seems to do essentially the same thing but require a modifier to be used with it. Is there documentation anywhere or could you perhaps share your code with me?
#include <TrinketKeyboard.h>
#define Key_1 0 // key Z,
#define Key_2 2 // key X
void setup()
{
pinMode(Key_1, INPUT);
pinMode(Key_2, INPUT);
digitalWrite(Key_1, HIGH);
digitalWrite(Key_2, HIGH);
TrinketKeyboard.begin();
}
void loop()
{
TrinketKeyboard.poll();
if (!digitalRead(Key_1))
{
if (!digitalRead(Key_2))
{
TrinketKeyboard.pressKey(0, KEYCODE_Z, KEYCODE_X);
}
else
{
TrinketKeyboard.pressKey(0, KEYCODE_Z);
}
}
else if (!digitalRead(Key_2))
{
TrinketKeyboard.pressKey(0, KEYCODE_X);
}
else
{
TrinketKeyboard.pressKey(0, 0);
}
}
Would also be cool if you post your code