This code allows a Cypress PSoC 5LP (model CY8KIT-059) to act as an HID Joystick for use with the FIRST Robotics Competition Driver Station. This particular box was designed to control Team 157 AZTECHS's robot for the REBUILT season, Sunstone. The box contains 4 toggle switches and 6 momentary pushbuttons, used for controlling the slapdown intake subsystem, dynamically modifying the shooter flywheel's velocity, and several manual subsystem overrides. This button box exists in addition to the operator controller, used for performing manual mechanism control after using the button box's switches to enable overrides.
HIDJoystick.cyprjProject to be opened in PSoC creator. GUI for editing.cy*filesHIDJoystick.cydwrUsed for pin assignment in PSoC creator.TopDesign.cyschUsed to design layout and define pins/components.main.cTranslates button presses to HID packets.
This button box contains 6 pushbuttons and 4 toggle switches, all treated as digital IO pins. It can be repurposed to support any amount of buttons that the PSoC can physically support by assigning pins/ports in PSoC creator and updating main.c to send the appropriate amount of bits in the HID packet.
What you'll need:
- a Windows PC/laptop with at least 1 USB-A port
- Cypress PSoC Creator (and a myInfineon account)
- .NET Framework 3.5
- Microsoft VC redist 2013
- Text editor (optional, as PSoC creator has a built-in editor)
Guide coming soon!