-
1Install Digispark libraries
If you have already installed digispark libraries you can skip this step, otherwise follow the tutorial "Connecting and Programming your Digispark"
Link: https://digistump.com/wiki/digispark/tutorials/connecting
-
2Install the modified Digikeyboard library
Download the modified library "DigiKeyboard_6keys.h" and copy it to the following folder/directory:
Under Windowsc:\Users\username\AppData\Roaming\Arduino15\packages\digistump\hardware\avr\1.6.5\libraries\DigisparkKeyboard\
Under Linux
/home/username/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/ -
3Include the modified library in your project
Whenever is necessary to use the modified version with 6 simultaneous keys, include the following library
#include "DigiKeyboard_6keys.h"
Then you can send simultaneous keys by adding keystrokes to output buffer
// clear buffer by default memset( DigiKeyboard.reportBuffer , 0, sizeof( DigiKeyboard.reportBuffer)); // Now add up to 6 keys to report DigiKeyboard.reportBuffer[i++] = _Key_A; DigiKeyboard.reportBuffer[i++] = _Key_B; DigiKeyboard.reportBuffer[i++] = _Key_C; DigiKeyboard.reportBuffer[i++] = _Key_D; DigiKeyboard.reportBuffer[i++] = _Key_E; DigiKeyboard.reportBuffer[i++] = _Key_F; // Now set to send the keystrokes in the next USB interrupt usbSetInterrupt( DigiKeyboard.reportBuffer, sizeof(DigiKeyboard.reportBuffer)); while (!usbInterruptIsReady()) { usbPoll(); _delay_ms(5); }
To release all the keys, simply send a clear buffer
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.