Close
0%
0%

Programmble USB Footswitch

A simple device that replicates a keypress via USB from a footswitch

Similar projects worth following
93 views
0 followers
I recently started playing Battlefield V. A great game but even with a gaming mouse and keyboard, fumbling around for some keys on the keyboard I find difficult. I concluded that a footswitch tied to a keypress would be a real help. Just step on the footswitch for something to be actioned. I particularly enjoy playing 'Support' in Battlefield V. The Support role allows the distrbution of ammunition to other players as they run out.

The obvious Arduino board to use I believe to be an Arduino Micro. It contains an ATmega 32u4 which has integrated USB electronics built in.

I did some research and found an ASCII table. This along with the Arduino 'Keyboard' library, which is now built into the IDE, allows a fairly easy piece of code to send keypresses. I asked my good friend Russ to help me out with the code and between us, we got it to work.

The current prototype is programmable via an 8 way DIP switch for any character on the keyboard. I have included a table in the code to aid with this. Just set the code on the DIP switch and every time the footswitch is actuated, the keypress will be sent to the device on the USB cable. Because of the way the Keyboard library works, if you hold the footswitch down, the character will be repeated at the rate you have your keyboard set at.

Although I have designed this as a PC accessory, it should also work on a MAC or Linux machine. I would like confirmation of this if anyone would like to drop me a line.

Footswitch7.ino

Arduino Sketch

ino - 7.67 kB - 06/17/2019 at 12:02

Download

Adobe Portable Document Format - 36.21 kB - 06/17/2019 at 12:02

Preview
Download

x-zip-compressed - 67.65 kB - 06/17/2019 at 12:01

Download

  • Painful Programming

    Steve Smith06/04/2019 at 08:57 0 comments

    The design changed a bit. Namely, the reduction of DIP Switches to just the one. All the storing of characters is now done in on board memory. Between us, Russ and I managed to get the code to run how it is supposed to. For a long while, we tried to use 'if' statements to read the status of the inputs, but this failed for some reason. After splitting the main Foot Switch routine up a little, it started to work correctly.

    I added a toggle switch for testing purposes, it disables the output allowing programming if the code got stuck in a loop, sending endless characters out. This happend on a few occasions! Now the code is fixed, I'm persuing the use of the toggle switch to change keypress modes between repeated and constant. At the moment, the code enables the Keyboard library, presses a key and then disables the Keyboard library. This doesn't allow for constant key presses. Another solution will need to be found.

  • Logic Issue

    Steve Smith05/13/2019 at 13:37 0 comments

    The PCBs turned up, but once built, the four DIP switches, since they are paralleled up, actually work together. A stupid mistake on my part! I am using one in place of the original prototype but have since redesigned the board to only have one DIP switch on board and to do the programming completely in memory. This will be a challenge for me (and Russ) but its doable. The new board includes tact switches for both 'Program' and 'Test' and an LED to indicate successful programming and actuations.

  • 4 Class System

    Steve Smith05/07/2019 at 11:23 0 comments

    The prototype had a single 8-way DIP switch. This was fine if you only wanted to use one character. In Battlefield V you can play as 4 different classes, Assault, Medic, Support and Recon. I thought it would be a good idea to have a DIP Switch for each of those so you could customise the action that each one actioned on the footswitch press. I added a 4 way rotary switch to the circuit and designed a PCB around it. I am currently waiting for them to arrive. Once proved, I will add the construction files, gerbers and schematic along with the code to this page.

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates