Skip to content

spaelectronics/Digispark-Joystick-Buttons-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Digispark Joystick Buttons Arduino Library

#Joystick Buttons Only Arduino Library for Digispark

This library is for the attiny85 running tiny core Arduino (e.g. the Digispark)

This implements a USB HID joystick (buttons only) device (upto 8 digital buttons) The code was borrowed mostly from the Digispark Joystick library

The library can be used for push-button, momentary switches, toggle switch, magnetic contact switch (door sensor)... It handle upto 8 buttons. As to the use of this code in Arduino, include DigiButtons.h as you would any other library. See the included sample for use of the functions.

Features

  • Supports upto 8 Buttons
  • All functions are non-blocking
  • Uses watchdog feature to help prevent crashes.

Available Examples

Available Functions

  • DigiButtons.setButtons(Byte)
  • DigiButtons.delay()
  • DigiButtons.update()

Installation

  1. Download the DigisparkJoystickButtons.zip
  2. In Arduino IDE, goto "Sketch >> Include Library >> Add .ZIP Library..."
  3. Select the zip file you downloaded in step 1.

Additional Information

Ability to use upto 8 Buttons. However, The DigiSpark only has 4 available pins to use for buttons/switches.

We have a few issues we have to workaround. Pin 1 is attached to a build-in LED, which acts like a pulldown resistor, which means we cannot use the internal pullup resistor on this pin. To workaround this issue, we can simply wire this switch/button to +5v instead of GND. All the other switches can be wired to GND.

Some DigiSpark clone boards keep P5 as reset pin and not yet enable P5 as a I/O pin in efuse. You may test the blink program on P5 to test if it can blink first. To work around this issue, please see: https://thetoivonen.blogspot.com/2015/12/fixing-pin-p5-or-6-on-digispark-clones.html

About

Joystick Buttons Only Arduino Library for Digispark

Resources

License

Stars

Watchers

Forks

Packages

No packages published