Putting My Foot Down

I can’t say I’m a kean games player exactly, but after receiving Call of Duty: Black Ops 4 free with my new PC’s processor, I thought I’d give the game a go. I did enjoy it for a while but I got introduced to Battlefield 5 by a friend. When I managed to take advantage of a special offer, I started to play and I found that Battlefield 5 suited my play style lots more than Call of Duty, good though it was.

Having said that, I have found that I have difficulty with certain key presses mid-battle. I needed a way that I could press a key utilising a foot switch to augment my control. I did some research and discovered that the Arduino Leonardo (or Pro Micro) had a USB interface built in and there is an Arduino library to take advantage of this, providing a way of emulating any HID input device.

I’m not the greatest of programmers, so I asked my friend Russ to help out. I showed him my code and he tided it up a bit and optimised it.

Programmable USB Foot Switch Prototype

The original prototype had four DIP switches on it to program one of four memories but I found, once the board was fabricated, that I’d made a massive error and managed to parallel all the DIPs meaning they would act in unison to produce the character code. I redesigned the board and included just one DIP switch.

The memories are saved by selecting a position with the rotary switch, setting the DIP switch with the binary value of the ASCII character you want in that memory position and pressing the ‘Program’ button. The LED flashes three times to confirm successful programming.

Once one of the four memories have been programmed, the foot switch can be depressed and the programmed ASCII character is sent to the device connected via USB. It acts like a general keyboard in that it auto repeats if you hold the foot switch down.

KiCad display of USB Programmable Foot Switch PCB

Getting the code to work correctly was a little painful, but between us, Russ and I have usable code. As with all projects on this site, after the design has been completely tested, the design files will be available for anyone’s use.

About admin

Twitter @Project_AVR
This entry was posted in Building, Coding and tagged , , , , , , , , , , . Bookmark the permalink.