User Tools

Site Tools


Digispark Keyboard, Mouse, and Joystick Libraries

Building off of the Arduino port of some of the VUSB code ( - I was able to setup a simple, very basic keyboard library for use with the Digispark.

Take a look at the example: File→Examples→DigisparkKeyboard→Keyboard

It is essential that DigiKeyboard.update() is called regularly (the beginning of the loop is good) to maintain USB communication. Using DigiKeyboard.delay() will automatically spam DigiKeyboard.update() calls during the delay period. If your loop code is fast just using DigiKeyboard.delay() will be sufficient.

Otherwise you can use buttons, inputs, etc to trigger the keystrokes.

For the example: Upload and then place the cursor in a text area, watch it type.

Some ideas:

  1. Print out the results of a sensor, say the temperature.
  2. Print those results only when a button is pressed.
  3. Use it to build an arcade controller.
  4. Use it for a password generator.

UPDATE: The software package now includes a Joystick and Keyboard library as well, they are similar and each include an easy to learn from example - thanks to duckythescientist on the Digistump forums for this contribution!

digispark/tutorials/digikeyboard.txt · Last modified: 2016/08/20 11:02 by Larek