Git Product home page Git Product logo

firegun's Introduction

FireGun

a MAME compatible lightgun that uses a Wiimote IR tracking camera fused with an overkill DCM filter just so you can shoot gangsta style

By Marc Paquette marc @^ dacsystemes.com

Uses highly customized DCM code from Razor AHRS https://github.com/ptrbrtz/razor-9dof-ahrs And more customized IR sensor code from http://www.kako.com/neta/2007-001/2007-001.html, www.stephenhobley.com, as well as http://procrastineering.blogspot.ca/2008/09/working-with-pixart-camera-directly.html Runs on a Teensy LC from PJRC http://www.pjrc.com/store/teensylc.html Relies on Sparkfun LSM9DS1 library https://github.com/sparkfun/SparkFun_LSM9DS1_Arduino_Library You may need to hack one of these to get the sensor: https://www.amazon.ca/PDP-Rock-Candy-Gesture-Controller/dp/B008U2XED0 Compiled with Arduino 1.6.9 & Teensyduino 1.30 http://www.pjrc.com/teensy/teensyduino.html

Form performance reasons, some trig equations have been simplified to their small angle approximation where suitable. I stopped optimizing when I figured out CPU load was less than 50% at ~100Hz. Also, the DCM / IR fusion stuff has been tuned experimentally. It may not work in all situations.

If you build one (or two), let me know!

USB Type should be "Keyboard + Mouse + Joystick" Alternatively, you can add a new Keyboard-less USB type by following instructions from tab "usb_desc" (My pc wouldn't boot with 2 identical Teensy USB Keyboards)

To build: -I stole a Nerf gun from my kids (don't be a jerk, get your own!) -Everything is held together nicely with hot melt glue -Look at the Buttons file to figure out how to connect the buttons -Look at the AccelGyro file to get the best way to connect to the imu -Finally look at the PVision.h file for additional details on the Ir sensor configuration

To calibrate the screen area: -Point to the upper left corner -Hold the trigger until the led comes on (default is 7 seconds) -While holding the trigger, move to the lower right corner -Release the trigger to save calibration

To switch between joystick & mouse mode: -Hold both the trigger & button 1 until led flashes once (quickly)

Troubleshooting: -Make sure to aim squarely at the sensor bar once in a while (this will re-aling the DCM heading) -If it starts to drift or becomed somewhat unuseable, just put the gun down for ~10 sec. This will recalibrate the gyros. -Make sure everything is connected correctly -Pullups are required on I2C lines, but don't overdo it -If initialization fails, leds will display error code (number of flashes): 3: Accel/Gyro error 4: IR Sensor error

This code is released under GPL v3.0: https://gnu.org/licenses/gpl-3.0.txt

firegun's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

himura95

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.