/Cyclocommandeur

System for using a bicycle as a controller in a game.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Cyclocommandeur

cyclocommandeur

System for using a bicycle as a controller in a game.

Any ideas for improving the documentation? Do not hesitate to open an issue!

Table of contents

Generalities

The remote control is a controller for playing car games, especially Horizon Chase Turbo.

The mapping of the controls is done as follows:

On the bike Player 1 Player 2 Effect
Pedal W Up arrow Accelerate
Left handlebar button A Left arrow Turn left
Right handlebar button D Right arrow Turn right
(soon) Brakes S Down arrow Brake/Reverse
(soon) Special button Space Right Ctrl Use nitro

⚠️ Warning! The mapping works for a QWERT* keyboard, so if you have issues, check that.

Setup

Skip to Usage if you want to know how to use.

⚠️ Warning! If you have already uploaded the code once/if the cyclocommandeur was provided to you by an operator, you do not need to perform the Code step!

Assembly

  1. Unfold the bike stand, and insert the rear wheel of the bike into it.

1

  1. Use serflex to secure the front wheel to the bike frame.

ℹ️ Note! Feel free to take a couple more just in case someone is too happy with the handlebars!

2

  1. Test that everything is stable by getting on the bike and pedalling hard. Feel free to ajust the gears so that the bike is not to loose, but not too hard.

ℹ️ Note! Depending on the bike, you may want to use additional weights for the bike stand.

  1. If everything is stable, put the buttons on the handlebars, and run the wires to the bike stand following the brake cable. Use electrician's tape to stabilise the buttons and the wires.

ℹ️ Note! Make sure the wires will not get into the pedals when using the bike. Feel free to take extra tape if something goes wrong.

4a 4b

  1. Make the wire connections using the following table:
Wire Goes on
VCC board Create a VCC line
GND board Create a GND line
Left button (one of the two wires) GND line
Left button (the other wire) Digital 4
Right button (one of the two wires) GND line
Right button (the other wire) Digital 5
Wheel sensor, red wire VCC line
Wheel sensor, black wire GND line
Wheel sensor, one of the two remaining wires Digital 2
Wheel sensor, remaining wire Digital 3

Beware, for Teensy boards, the pinout is quite different!

Teensy pinout

  1. Plug the board's USB cable into a computer, start the game, and test that everything works!

Code

Please refer to the Cyclocommandeur main code README.

Usage

As stated, we are using Horizon Chase Turbo as our game for that project, but this should work with any other game.

ℹ️ Note! This setup requires an operator to handle the menu.

usage1

  1. Once the game is started, select "Multiplayers".

usage2

  1. Use each bike's right button to select a profile. If it worked, use the keyboard to confirm (Space and Enter), then use Enter to continue.

usage3 usage4

  1. Select "Campaigns".

usage5

  1. If you want to take it easy on your players, select "Rookie Series", else, select the traditionnal "World Tour" - or anything you want, really. From there, simply select the circuit you want to play.

usage6

  1. For car selection, this can be done by the bikes' buttons, but you still need to confirm on the keyboard.

usage7

  1. Finally, enjoy the game! The operator can restart the game at any point by pressing Escape then R.

usage8 usage9

⚠️ Warning! This controller is sportive. Please remind your players that they should take it easy - it's more of a marathon than a race, really, as the car does not go faster the harder you pedal.

Troubleshooting

Feel free to use the test code for hall sensor to check if you sensor is working correctly. Basically, if you have a 1 when no magnet, but a 0 when magnet, it's working!