Introduction: LittleBits Game Controller
This instructable will show you how to make a game controller with littlebits.
Difficultly Level: Very Easy (can be done in less than 30 mins)
The controller is a really simple one, just one button and we'll make it work with a Flappy Bird clone game, made using Construct 2, an HTML5 game development engine. If you are interested in how it (the game) was made, have a look at this tutorial.
Step 1: What You Will Need
- 1x Power Module
- 1x Arduino at Heart Module
- 1x Button Module
- 1x 9V Battery
- 1x MicroUSB cable
You will need a computer running Microsoft Windows to complete this project. In addition, you will need the following:
- Arduino IDE. Download Here
- Python 3.4 . Download Here
- Python Modules
- Open CMD (command prompt) and run "pip install pywin32" (no quotes)
- If that doesn't work, download the installer from here (it's a long list of module so you'll have to scroll down to PyWin32) and run it
- Not sure if you need this one. But I was getting an error about it when I tried to run the project. Download it here.
Step 2: Connect the Littlebit Circuit
As seen in the photo. First get the power module, attached the button module then attach the arduino module on pin a0.
The best part about littlebits is that making circuits is ridiculously easy. The pieces snap together like legos and have magnetic ends so short circuits are almost, if not at all, impossible.
Step 3: Load the Arduino Program Onto the Module
Download the attached file and open it in the Arduino IDE.
Connect the Arduino module to your computer and make sure the circuit is turn on at the Power module.
In the Arduino IDE, open the Tools menu and under the Board sub-menu, select Arduino Leonardo.
Also select the serial port which your Arduino is connected to under Tools > Serial Port.
Upload the program by select upload on the toolbar or under the File menu.
Step 4: Test the Code
Download the attached python (.py) file and save it in a convenient location on your computer.
Open Command Prompt and run the python script, i.e., python path\to\script (refer to screenshot)
Step 5: Game On!
All done! Now it's time to try the controller with our game.
Make sure the script is running in command prompt.
Download the attached Construct (.capx) file and open it in Construct 2. Run it and use your controller :)
See video for demo.
We have a be nice policy.
Please be positive and constructive.