CS353_GameController
by CS353_BananaorNite in Circuits > Microcontrollers
128 Views, 0 Favorites, 0 Comments
CS353_GameController
Our group created a wireless controller for manipulating a game object in Unity space. The microcontroller controls the objects by sending acceleration and heading data to the Unity scene via a Bluetooth Low Energy (BLE) and LSM303 breakout board. It also features a joystick for some added functionality. Lastly, there are two modes of output: a vibrating motor for haptic feedback and sound from the Unity scene. In the future, we are looking to make the scene more complex so adding objects that move and can generate sound as well. We are also looking to add more visual outputs to the prototyping board itself, perhaps with LEDs.
Supplies
- Analog 2-axis Thumb Joystick
- Bluefruit LE
- Triple-axis accelerometer + Magnetometer (LSM303)
- Electret Microphone Amplifier
- Unity game engine
- Adafruit Haptic Motor Controller
- DC Vibrotactile Motor
- Arduino Due
- Prototyping board(s)
- Multicolored non-threaded wire and threaded wire
- Soldering iron
- Soldering sponge
- Water
- Spool of solder
- Wire stripper
- Wire cutter
- Shears
- Multimeter
- Female and male header pins
Downloads
Programming the Breakout Boards
To program the breakout boards:
- Refer to attached files
- Use Arduino version 1.8.15
To download Arduino:
https://www.arduino.cc/en/software
Programming the Unity Scene
To program the Unity Scene:
- Refer to attached project
- In the scene, the joystick controls the color of the paint from the gun and the gun's orientation.
- The LSM303 controls the camera in the scene.
Soldering the Prototyping Board
To solder a prototyping board:
- Assemble three separate prototyping boards quadrants, this can be done by using the shears to split one or more prototyping boards into quadrants.
- Gather all other materials
- Solder 1 row of nine-pin long female header pins into two of the quadrants. Solder 1 four-pin long row and and 1 eight-pin long row into the last quadrant. Be sure that these last two are perpendicular on their quadrant.
- Stick the motor controller and LSM303 into the rows in the quadrant with two rows. Stick the BLE in one of the others and the microphone in the last one.
- Solder two pins in the CS and IRQ board rows and place these two pins in the digital pin holes such that the IRQ row is in pin 10 and the CS row is in pin 11.
- The quadrant with the haptic motor controller and LSM303 should be placed such that the pins of the controller's header hover just behind the communication pins.
- The microphone quadrant should be placed so its header pins hover over A8, A9, and A10.
- The pins sticking out from underneath the prototyping board quadrants can be snipped off with the shears or wire cutters.
- Solder lines from the SCL and SDA pins in the Due to the SCL and SDA pins in the LSM303, the BLE, and motor controller.
- Solder lines from the 5V and GND of the power pins to the GND and VIN/VCC pins of all the breakout boards.
- Use more female header pins on the appropriate quadrants to plug the wires for the joystick.
- The joystick wire pins are as follows: SEL to D8, XOUT to A1, YOUT to A2, GND and VCC as normal.
- The OUT pin for the microphone goes to A0.
- The MOSI, MISO, and SCK pins for the BLE are located near the communications pins.
- Use the Multimeter to check for short circuits.