If you only want to use one of these two control options, you can use fewer connections. On an exercise bike, you can use a two-handed adapter like the Gamecube one. small proto board (under $1 on Aliexpress).Ī Nunchuck is good for one-handed use with an elliptical machine.capacitors: 10uF electrolytic, and optional 100nF.
The cost is under around $10, plus case (I have a 3D printable design), wires and solder. The adapter works as a standard USB controller, so you can use it with Windows, Linux, OS X, Android, etc.Īs a bonus, the adapter has all the functions of this project, working as a full-function Gamecube adapter, letting you use Gamecube controllers on a computer, including controlling games with Gamecube/Wii compatible Dance Dance Revolution dance mats. (Alternately, one could use a hall-effect magnetic sensor like this device, and change the circuit and software.)
The device can emulate a USB game controller, keyboard, mouse, XBox 360 controller, or some combination of the first three.ĭirection of motion is currently not detected: to switch between forward and reverse motion, the adapter has a toggle switch. There are a number of built-in control schemes in the software, and others can easily be added in the code. For instance, smaller kids may need to have their speed boosted a little, and some games may use a different control scheme. There are a lot of different control modes. Additionally, you plug a standard Wii Nunchuck or Gamecube controller into the adapter for joystick movement, buttons, etc. The elliptical/bike rotation speed controls the controller slider. To use, you need to tap into the rotation sensor on the elliptical or exercise bike (if your rotation sensor works differently from the ones on our machines-about 3v, active low-you may need to modify the circuit and/or code). The STM32F1 is fast and cheap and has full-speed USB support, so it's perfect for the project. The main hardware is a $2 "black pill" STM32F103C8 development board with the stm32duino Arduino core and a USB HID library I developed based on libarra111's core fork. It certainly motivates one to pedal fast when playing racing games. To encourage exercise in self and family, I made an adapter that emulates a standard USB game controller adapter but controls game movement speed by pedalling on an elliptical machine or exercise bike.