Skip to content

Latest commit

 

History

History

Arduino

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Arduino software

It uses the HID keyboard library.

For details about how set up your board see setup-instructions.md.

Only eight buzzers are supported and the Arduino has twelve digital I/O pins, so no matrix circuit is needed.

Supported hardware

Not all Arduino boards can be used because the keyboard library requires a microcontroller with built-in USB support. For example, the Arduino Uno and Mega have a separate chip to do USB communication which doesn't let us do HID keyboard.

This project uses an Sparkfun Pro Micro (informally called "Arduino Pro Micro"). It has ATmega32U4 chip which has USB built-in!

KiCad symbol pin vs Arduino pin number

The KiCad symbol & footprint are from the ProMicroKiCad repository by GitHub user Biacco42. The pin numbering in the KiCad symbol starts at one and increases by one for each pin.

To use the Arduino digitalRead() function we need to know the "Arduino pin number". According to the SparkFun Pro Micro Hookup Guide, the Arduino pin numbers are discontinuous and not monotone.

Sparkfun Pro Micro KiCad symbol
KiCad symbol
Sparkfun Pro Micro pinout
Arduino pin numbers

Here's a a table to cross-reference the pin numbers (excluding RX, TX, RAW, GND, and VCC):

KiCad
symbol
Arduino
pin
   KiCad
symbol
Arduino
pin
5 2    20 21
6 3    19 20
7 4    18 19
8 5    17 18
9 6    16 15
10 7    15 14
11 8    14 16
12 9    13 10

Debouncing

Contacts in a mechanical switch bounce when actuated, which makes the signal appear to be repeatedly opening/closing. Debouncing waits for the signal to settle before deciding if the switch moved.

The debouncing logic is from an Arduino example, which is accessible online and in the Arduino software from File > Examples > 02.Digital > Debounce.

I measured the settling time for both brands of footswitches I'm using then chose 5 milliseconds debounce time.

Oscilloscope trace show switch bounce
TEMCo
Oscilloscope trace showing switch bounce
Treadlite