Introducing the itapstick: Video Game USB Mouse Stick for Wii Nunchuk Controllers

Similar documents
PROGRAMMING SERVO MOTORS OF ROBOT ARM TO CONTROLLED DIRECTIONS VIA WII NUNCHUK JOYSTICK

Meditation Trainer. Created by Collin Cunningham. Last updated on :36:45 PM UTC

uemis CONNECT: Synchronisation of the SDA with myuemis

Grove - Gas Sensor (O2)

Laboratory 2(a): Interfacing WiiMote. Authors: Jeff C. Jensen (National Instruments) Trung N. Tran (National Instruments)

ELIMINATOR COMPETITION DRAG RACE Program Manual Firm Ver 4.11

Swing Labs Training Guide

Technology. In the My Files [My Files] submenu you can store all the programs that you have made on the NXT or downloaded from your computer.

IDeA Competition Report. Electronic Swimming Coach (ESC) for. Athletes who are Visually Impaired

Technology. Using Bluetooth

SHIMADZU LC-10/20 PUMP

Using the Lego NXT with Labview.

LED CONVERSION BOARD - YAKUZA SERIES EGO/GEO

FireHawk M7 Interface Module Software Instructions OPERATION AND INSTRUCTIONS

ITF SCORER ONLINE TRAINING SETUP

Race Screen: Figure 2: Race Screen. Figure 3: Race Screen with Top Bulb Lock

Diver-Office. Getting Started Guide. 2007, Schlumberger Water Services

1. Set up your Stick Up Cam Wired.

Setting Up the Ingenico isc250 Pinpad via USB

APA software instruction manual

ARCCOS 360 NEW USER GUIDE

1. Set up your Stick Up Cam Wired.

Stick Up Cam Wired. 02_Stick_Up_Cam_Wired_MANUAL_ANZ.indd 1

Digi Connect ME 9210 Linux: 2 nd serial over FIM

HOW TO RESET CLOCK ON FITBIT DOCUMENT

Grove - Gas Sensor(MQ9)

Action Replay Tutorial Ds Pokemon White 2 Code All Pokemon Modifier

12/07/2016 Grove Gas Sensor(O₂) Wiki

Written Report of Robot Design

XSeries G4 Plunger Application rev. AA

ELIMINATOR INSTRUCTIONS Table of Contents

Setting up the Ingenico isc250 Pinpad via USB in Windows 8

Please note. Right now, the ongoing version of emax (3.9C) is not already completely compatible with the newest firmware version of Shimano!

Callaway upro Golf GPS. User Guide (v1.3) 2009 Callaway Golf Company

XC2 Client/Server Installation & Configuration

siot-shoe: A Smart IoT-shoe for Gait Assistance (Miami University)

Feasibility of Using the Wiimote Multi-point Interactive Whiteboard in School

Stick Up Cam Battery

Silkrip. ORR Computer. Owner s Manual. Silkrip Motorsports LLC. Rev H 4/13/2017 IMPORTANT CHANGE TO SENSOR WIRING! Tom King

Fifa 12 Guide Book Xbox 360 Controls Defending

Tru Flight TRUFLIGHT INSTALLATION GUIDE TRUGOLF.COM

Panther 5 Acute Care Ventilator

NEULOG OXYGEN LOGGER SENSOR GUIDE

Rescue Rover. Robotics Unit Lesson 1. Overview

The examples below are a starting point, and some fine tuning may be required.

Slide 1 - Welcome to an Overview of the Student Center and New Titan Online

CONSUMER MODEL INSTALLATION GUIDE

MAROC Computing Guide for running an event

Owners Manual Release Date: Thursday, December 29, 2011

WELCOME TO THE REVOLUTION

Perfect Golf Quick Start Guide

DIY - PC - Interface for Suunto Cobra/Vyper/Mosquito

Technology. Using Bluetooth

WELCOME TO THE FUTURE OF TELEVISION. User Manual

Zombie Tag Game with Circuit Playground Express

Software for electronic scorekeeping of volleyball matches, developed and distributed by:

How to zero calibrate your CO2 sensor with a GSS evaluation kit

PRODUCT MANUAL. Diver-Mobile for Android

FIRST Tech Challenge Scorekeeper Manual Part II: Scoring System Guide (For Non-League Event Types)

[XACT INTEGRATION] The Race Director. Xact Integration

User Manual. ENGLISH Pages FRANÇAIS Pages ESPAÑOL Páginas DEUTSCH Seiten 53-69

Chapter 6. Gas Analyser Interface. Hanatech Co., Ltd.

WELCOME TO THE FUTURE OF TELEVISION. User Manual

D-Opto Dissolved Oxygen Sensor Operation Manual for the D-Opto 4-20mA

This addendum describes the back pressure control implementation if FuelCell Version 4.1a and later.

Stand-Alone Bubble Detection System

Wickets Administrator

Gravity: How fast do objects fall? Teacher Version (Grade level: 4 7)

Dynamically Reconfigurable Miniature Golf Course

OC508 Programmable mv Calibrator

Experiment AMe-1: Small Animal Respiratory Exchange Ratio (RER)

ECE 477 Digital Systems Senior Design Project Rev 9/12. User Manual

SWIM MEET MANAGER 5.0 NEW FEATURES

HART Communications Board

DDR Dive Data Recorder Manual - Rel /12

Experiment AMe-1: Small Animal Respiratory Exchange Ratio (RER)

STAND alone & p.c. VERSION

TESLAGON. ShotHelper Manual. How to install and use the Program. Version /30/2014

USER GUIDE USER GUIDE

Materials: Laminated sphero command sheets ipad Sphero Sphero charger Tape Measure. Apps:

SENSUS PRO MANAGER (for SENSUS or SENSUS PRO devices) User s Guide -- Windows. Version 2.0 Published October 17, ReefNet Inc.

League Manager Tutorial

Oxygen Meter User Manual

Información General. Prizes

Model 6202 Reduced Oxygen Breathing Device 2

REMOTE CLIENT MANAGER HELP VERSION 1.0.2

TR Electronic Pressure Regulator. User s Manual

Getting Started with the LabVIEW Toolkit for LEGO MINDSTORMS NXT

Edge Isolation Tool. Standard Operating Procedure. Version 1.1. Date: Prepared by, Sandeep S S. Department of Electrical Engineering

The NXT Generation. A complete learning solution

INSTALLATION PROCEDURE 1/4 & 1/8 MILE PERMANENT TRACK

Battle Adapter for Heng Long Tanks Installation & Product Notes

SCIENTIFIC DATA SYSTEMS, INC. Depth Tension Line Speed Panel. DTLS Manual

Microfluidic Demonstration

[CROSS COUNTRY SCORING]

STRIDES USER GUIDE Version September 2014

D-Opto. Dissolved Oxygen Sensor. Operation Manual (Software Version 1.0)

Robot Soccer Challenge

New product release. Universal Rebreather Monitor (URBM) Three cell / Independent backup

Center Command Version 3. Operations Manual

Transcription:

Introducing the itapstick: Video Game USB Mouse Stick for Wii Nunchuk Controllers Created by itaparcade Last updated on 2016-09-03 02:11:57 AM UTC

Guide Contents Guide Contents Overview Prerequisite Guides Parts Tools & Supplies Learn Leveraging the Wii Nuncuck Library Leveraging the Adafruit Pro Trinket Mouse Library The itapstick Project Build Program Play 2 3 3 3 4 5 5 5 5 7 9 14 Page 2 of 14

Overview Ever wanted to get in on some video game martial arts action and feel like the legendary "Bruce Lee". This 10 minute project will allow you to at least virtally feel like a martial arts expert using Wii Nunchuks (wired and wireless) in combination with a PC game found on Steam known as One Finger Death Punch (OFDP). Using a Pro Trinket and the Nunchucky interface board, you can create a Wii Nunchuk to USB Mouse conversion stick that translates Wii Nunchuk responses into left and right mouse clicks to fight off the agressive Ninjas on the OFDP game. As a bonus, the joystick on the Wii Nunchuk is programmed to be used as a mouse cursor to select different map locations in the game. This allows you to completely play this game with only the Wii Nunchuks. Both wireless and wired Nunchucks can be used with the itapstick project. You have to build and try this project for yourself to experience the fun you'll have fighting off ninjas using Wii Nunchuks. If you don't believe me, check out the video snippet below that was taken at a Mini Maker Faire using some wired blue third-party Wii Nunchuk controllers. Looks like someone is having fun to me! If you like this project, follow us on Twitter @itaparcade. In the meantime, let's go ahead and get started with making your own itapstick! Prerequisite Guides I recommend checking out the following tutorials below before starting this project. These tutorials will help you get familiar with the Pro Trinket and help you get setup and configured with the Arduino IDE and libraries. Parts Introducing the Pro Trinket (http://adafru.it/nxf) Pro Trinket as a USB HID Mouse (http://adafru.it/rd5) Components for the itapstick and tools for building it can be found at Adafruit. These components and tools are featured products on the right sidebar. Search on amazon.com if looking for a wireless Wii nunchuk controller. Pro Trinket (http://adafru.it/2000) Nunchucky (http://adafru.it/345) Wii Controller (wired) (http://adafru.it/eq5) itaparcade is also offering an itapstick kit for this project with a preprogrammed Pro Trinket. You can purchase this from our Tindie itapstick Kit Project Page 3 of 14

Site (http://adafru.it/eq6). Tools & Supplies You'll need a soldering iron and some solder to build this project. Solder Iron (http://adafru.it/1204) + Solder (http://adafru.it/734) Page 4 of 14

Learn Leveraging the Wii Nuncuck Library Tod E. Kurt (http://adafru.it/eq7) generated one of the first blog articles that discussed how to send and decode I2C commands to the Wii Nunchuck using an Arduino UNO in February 2008. He created a nunchuck library as well as produced a wii chuck adapter to easily interface with existing Wii nunchuck controllers (eliminating the need to use extension cable adapters for interfacing). From his work, numerous makers have extended his library and modified it to deal with both "original" as well as "third-party" Wii nunchuck controllers. Much of his work and others inspired a Wii nunchuck library by Tim Teatro (http://adafru.it/eq8) discussed in his blog on February 2012. Other Wii nunchuck libraries might exist, but I plan to use Tim's Wii nunchuck library as a basis for the itapstick project. To learn more about what has been done with various Wii nunchuck libraries check out the blogs from both Tod and Tim. Leveraging the Adafruit Pro Trinket Mouse Library Mike Barela (http://adafru.it/rd6) has a great article on using the Pro Trinket as a USB HID Mouse based on the Adafruit Pro Trinket mouse library. Since the Pro Trinket does not actually have a USB interface chip, he shows how you can leverage the V-USB library to emulate a USB HID Mouse based on this library. Please review the article by Mike for more background information about this library. The itapstick Project A combination of the Wii nunchuck library and the Pro Trinket Mouse library provides the foundation for creating the itapstick USB Mouse Stick for Wii Nunchuk Controllers. This project was motivated from playing the OFDP video game found on Steam for the PC. The YouTube video showing the game in action is shown below. Rather than using the left and right mouse buttons or an XBox controller for playing the game, why not use Wii nunchuck controllers. If we can program the "Z" button to represent a left mouse click for one nunchuck and a right mouse click for the other nunchuck, the fun factor of OFDP dramatically increases. While we are at it, let's use the joystick on the nunchuck to control the mouse position so we can select various areas of the map. With these features combined with two wireless wii nunchucks, the Nunchuket Wii Nunchuck to mouse USB interface stick was born! Page 5 of 14

Page 6 of 14

Build Transforming the Adafruit Pro Trinket and nunchucky into a wireless USB mouse stick first begins by soldering the nunchucky to the Pro Trinket. The only soldering required for this entire project involves two steps: 1. Solder the 4 pin header to the Nunchucky 2. Solder the other end of the 4 pin header to the Pro Trinket. Before soldering the other end to the Pro Trinket make sure Pro Trinket pins are connected to the Nunchucky based on Pin A2-->Gnd, Pin A3-->3.3v, Pin A4-->Data, and Pin A5 --> Clk A picture of the nunchucky soldered to the Pro Trinket is shown below. It is important to make sure the Nunchucky is soldered and oriented correctly with respect to the Pro Trinket. You can use a 3.3 volt or 5 volt Pro Trinket for this project, but for the wireless Wii receiver to operate properly only a 5 volt Pro Trinket can be used! Page 7 of 14

Page 8 of 14

Program Once adding the Pro Trinket Mouse Library to you Arduino programming environment. Copy the itapstick project code below and create the itapstick Sketch in the Arduino IDE. Since you will need the wiinunchuk.h library, please proceed to download this library and add it to your project as well. wiinunchuk.h http://adafru.it/euc /************************************************************************* itapstick Project: Wii Nunchuk-to-Mouse USB Controller Stick Copyright (c) 2015 itaparcade, LLC Date Created: 9 March 2015 Date Modified: 10 March 2015 Version: 1.0 Visit us at itaparcade.com Follow us on Twitter @itaparcade Function: Wired and Wireless mouse emulation (mouse cursor, left click, and right click) from Wii Nunchuk to support Tap and Mouse control based Games for PC, Mac, and Android based games Support our open source projects by getting an itapstick Kit Available: https://www.tindie.com/products/itaparcade/itapstick-wii-nunchuck-to-mouse-usb-stick/?pt=ac_prod_search Microcontroller: Pro Trinket (3 or 5 volt) from Adafruit.com Note: Need 5 volt Pro Trinket for Wireless Wii Nunchuks! Wii Nunchuck Library Code from: Author: Tim Teatro Date : Feb 2012 http://www.timteatro.net/2012/02/10/a-library-for-using-the-wii-nunchuk-in-arduino-sketches/ ************************/ #include <Wire.h> #include <EEPROM.h> #include "wiinunchuk.h" // Wii Nunchuk Library #include <ProTrinketMouse.h> // Pro Trinket V-USB mouse emulator int led = 13; // Use LED on Pro Trinket for Status and Button Press Indicator int loop_cnt=0; int mode = 0; // Defines mode of the itapstick: left mouse click is C or Z button // parameters for reading the joystick: Page 9 of 14

int range = 40; // output range of X or Y movement int threshold = range/10; // resting threshold int center = range/2; // resting position value void setup() { pinmode(led, OUTPUT); nunchuk_setpowerpins(); // set power pins for Wii Nunchuk nunchuk_init(); // initilization for the Wii Nunchuk while(!nunchuk_get_data()){ // loop until Wii Nunchuk is connected to Nunchucky nunchuk_init(); nunchuk_get_data(); delay(500); // let user know they can select mode within (5 seconds) delay(5000); // check if user is holding any of buttons to change mode nunchuk_init(); // Once connected lets get additional data to determine if C or Z nunchuk_get_data(); // button is being held down for programming mode delay(10); nunchuk_get_data(); delay(10); nunchuk_get_data(); int leftstate = nunchuk_zbutton(); int rightstate = nunchuk_cbutton(); if(leftstate){ // save mode for future time if Z is defined as left mouse click mode = 0; EEPROM.write(0, 0); Page 10 of 14

delay(3000); else if(rightstate){ // save mode for future time if C is defined as left mouse click mode = 1; EEPROM.write(0, 1); delay(3000); else { mode = EEPROM.read(0); // no mode selection load in saved mode // get LED indicator ready to show when buttons are being pressed // Start Pro Trinket into Mouse mode TrinketMouse.begin(); // Initialize mouse library void loop() { if( loop_cnt > 10 ) { // every 10 msecs get new data loop_cnt = 0; if(nunchuk_get_data()) // only check for data if data is available from Wii Nunchuk { // right and left click control int leftstate = nunchuk_zbutton(); int rightstate = nunchuk_cbutton(); Page 11 of 14

if (leftstate) // if button is pressed update { if(mode==0){ TrinketMouse.move(0,0,0,MOUSEBTN_LEFT_MASK); else { TrinketMouse.move(0,0,0,MOUSEBTN_RIGHT_MASK); // show button is pressed by LED else if (rightstate) // if button is pressed update { if(mode==0){ TrinketMouse.move(0,0,0,MOUSEBTN_RIGHT_MASK); else { TrinketMouse.move(0,0,0,MOUSEBTN_LEFT_MASK); // show button is pressed by LED else { TrinketMouse.move(0,0,0,0); // if no button is pressed update // show no button is pressed by LED int xreading = nunchuk_joy_x(); // read the x axis xreading = map(xreading, 38, 232, 0, range); // map accordingly int xdistance = xreading - center; if (abs(xdistance) < threshold) { xdistance = 0; int yreading = nunchuk_joy_y(); // read the y axis yreading = map(yreading, 38, 232, 0, range); // map accordingly int ydistance = yreading - center; if (abs(ydistance) < threshold) { ydistance = 0; if ((xdistance!= 0) (ydistance!= 0)) { // move the mouse based on x and y TrinketMouse.move(xDistance, -ydistance, 0, 0); loop_cnt++; delay(1); We have built in two modes of operation for using the itapstick. One mode allows the right Page 12 of 14

click and left click to correspond to the "Z" and "C" respectively. The other mode allows the right click and left click to correspond to the "C" and "Z" respectively. You can set the mode when initially connecting the Pro Trinket to the computer. Once setting the mode, it will remember the next time so you don't have to set it every time. Page 13 of 14

Play Onced program, the itapstick can be used with both wired and wireless Wii nunchuk controllers. An OFDP setup on a PC tablet with two itapsticks is shown in the video below. We have two wireless Kama Wii Nunchuks interfaced to our itapsticks. You can always use the wired wii nunchuk controllers found at adafruit (http://adafru.it/342)as well if you are not able to find wireless ones. Let the OFDP fun begin! Adafruit Industries Last Updated: 2016-09-03 02:11:56 AM UTC Page 14 of 14