2 1 Introduction The Nintendo WiiMote is a handheld wireless game controller that measures acceleration and light intensity to determine motion and position, as well as momentary depressions of user buttons. 1.1 Goals In this lab, you will: 1. Interface with the Nintendo WiiMote. 2. Send binary commands to the WiiMote to poll its accelerometer and set LED and rumble status. 3. Calibrate the accelerometer and display the results. This lab should take 1 hour to complete. 1.2 Required Reading Read the following material in advance of your laboratory session: 1. Lee & Seshia [1] (a) Fixed-Point Numbers, pp Technical Guide to the Wii Remote (unofficial) [2] 1.3 Equipment 1. PC computer running Windows XP. 2. Nintendo WiiMote. 3. Bluetooth radio with standard Microsoft Bluetooth stack. 4. National Instruments LabVIEW Equipment Introduction The Nintendo WiiMote (Fig. 1) is part of the Nintendo Wii entertainment system, is a handheld wireless game controller that measures acceleration and light intensity to determine motion and position, as well as momentary depressions of user buttons. The three types of actuators on the Wii Remote are a speaker, LEDs, and a rumble unit that vibrates the device. While the Wii Remote is simple, popular, and widely available, its most compelling feature is that can serve as a conceptual bridge from computer-based to embedded-based measurement. An onboard embedded processor (Fig. 2 on the remote contains an analog-to-digital converter (ADC) to sample the accelerometer and a radio to broadcast Bluetooth messages to a host. An online community of embedded systems hackers reverse-engineered and documented these messages [2]. Take note that measurements are not read as floating-point voltages, but instead as binary values output by the ADC on the remote. 1

4 3 Procedure 3.1 Load the Template Project Download the lab2afiles.zip from the course website to your computer, and extract it to the folder U:\EECS149. Open the LabVIEW project file (.lvproj) that has been extracted to this folder. 3.2 Configure Equipment From your project window, open WiiMote Pair.vi. This is a VI that will automatically pair your desktop computer to your WiiMote. You do not need to modify or view the block diagram. When pairing the WiiMote, you must hold down both the 1 and 2 user buttons for the entire pairing process. Do not let go until the pairing VI has completed. Key in the MAC address of your WiiMote (written on the side), and run the VI to pair. 3.3 Review and Execute the Template Code From your project window, open the Lab 02a VI. This is the VI you will modify to complete this lab. The VI will periodically poll sensors, and allow you to transmit messages via Bluetooth. 3.4 Toggle User LEDs Modify the values for Report ID and Payload to toggle user LEDs. 3.5 Toggle Rumble Modify the values for Report ID and Payload to toggle the rumble. 3

5 3.6 Calibrate Accelerometer You will see the raw ADC output from the WiiMote accelerometer. These values are for the X and Y axes of the accelerometer (Fig. 3). Modify the block diagram to display a new chart where the accelerometer values have been scaled to 1g. Calibration parameters should be measured at runtime by pressing the appropriate record buttons when the WiiMote is at varied orientations. The X, Y 0g offset should record the value of each accelerometer axis when the WiiMote is positioned so that both axes are perpendicular to gravity (hence measure 0g). Extend the template VI to record each accelerometer axis when the WiiMote is positioned so that the axis is parallel to gravity (hence measuring +1g). Once the user has performed the calibration, your VI should display the accelerometer measurements scaled to [ 1g, 1g]. Figure 3: Nintendo WiiMote Axes 4 Acknowledgment We thank the University of California, Berkeley, Department of EECS Instructional Support Group (ISG) and Electronics Support Group (ESG) for their continued efforts in supporting this lab. References [1] E.A. Lee and S.A. Seshia, Introduction to Embedded Systems - A Cyber-Physical Systems Approach, digital version Berkeley, California, Available: DigitalV1_03.pdf. [Accessed January 25 th, 2011]. [2] Ian Rickard, Wiimote website. Available: wimote.html. [Accessed January 30 th, 2011]. 4

6 5 Laboratory 2(a): Interfacing WiiMote Objectives and Checkout Name: Date: Lab Section: 1. ( / 5) Successfully pair with your WiiMote. 2. ( / 10) Change the value of the Report ID and Payload front panel controls to turn all four WiiMote LEDs on. 3. ( / 10) Change the value of the Report ID and Payload front panel controls to enable and disable the WiiMote rumble. 4. ( / 50) Using Record buttons, calibrate the WiiMote accelerometer to display values between [ 1g, 1g]. You will need to use shift registers to save the value recorded when the record buttons are pressed. You can follow the design pattern shown for recording the X, Y 0g offset. Do not hard-code any scaling, offset, or other calibration parameters. All parameters should be recorded at runtime following user button presses. 5. ( / 25) Correctly calculate pitch and roll and display on the front panel. 6. ( / 0) BONUS (up to +5): Replace Report ID and Payload numeric controls with buttons for each of the user LEDs and for the rumble status. When the Transmit button is pressed, these controls should be read, and the appropriate report ID and payload should be transmitted to the WiiMote. 6 Lab Writeup Prompts In your lab writeup, please address the following questions: 1. In the template VI you were provided, what was the function of the shift registers? The shift registers retain the previous calibration parameters. When a record button is pressed, they store the new value. 2. What are some advantages of dynamically calibrating a sensor, instead of simply recording calibration parameters once and hard-coding them in software? Dynamic calibration accounts for variations between sensors (for example two WiiMotes may not measure exactly the same), or physical influences on measurements such as temperature or ambient noise. Dynamic calibration would allow, for example, pitch and roll calculations on the moon. 3. What equation did you use to scale the raw accelerometer measurement to [ 1g, 1g]? A common equation is x norm = x x offset x scale. 4. What did you like about this lab, and what do you think could be improved? 5

7 7 Laboratory 2(a): Interfacing WiiMote Prelab Exercises Name: Date: Lab Section: 1. What is the WiiMote Report ID and payload to turn on LED 3? [0x52][0x11][0x40]. 2. What is the WiiMote Report ID and payload to turn on the rumble? [0x52][0x11 / 0x13 / 0x14 / 0x15 / 0x19 / 0x1A][0x01]. Only the least significant bit of the last byte needs to be set, so any byte with least significant bit 1 will work. 6

1 Abstract Wiimote Visualization Through Particles Joshua Jacobson Since 2006, the Wii video game console has been found within homes throughout out the world. The Wiimote exists as the primary input method

HumiSys HF High Flow RH Generator Designed, built, and supported by InstruQuest Inc. Versatile Relative Humidity Generation and Multi-Sensor System The HumiSys HF is a high flow version of the previously

Bluetooth is a communication technology that makes it possible to send and receive data without using wires. Using the Bluetooth features, you can set up a wireless connection between your NXT and other

Diver-Office Getting Started Guide 2007, Schlumberger Water Services Copyright Information 2007 Schlumberger Water Services. All rights reserved. No portion of the contents of this publication may be reproduced

Long term stability tests of INO RPC prototypes While the problem of sudden aging in the glass RPC prototypes is being investigated, a few RPCs of dimension 40 cm 30 cm were fabricated, using glass procured

Boyle s Law: Pressure-Volume Relationship in Gases The primary objective of this experiment is to determine the relationship between the pressure and volume of a confined gas. The gas we will use is air,

Viva TPS October 2010 TS11/15 Total Stations Summary Leica builds total stations to the highest quality and calibrates each instrument before it leaves the Factory. After the instrument is shipped or used

Drift-Chamber Gas System Controls Development for the CEBAF Large Acceptance Spectrometer M. F. Vineyard, T. J. Carroll, and M. N. Lack Department of Physics University of Richmond, VA 23173 ABSTRACT The

For DST Host version 7.0 onwards, published October 2017 Cefas Technology Limited CONTENTS About this Manual... 2 Conventions used in this Manual... 2 Getting Started... 3 Installing the Host Software...

Page 1 of 9 SSI Solaris 150 RTA The Solaris 150 RTA is a rapid thermal annealing system capable of handling sample sizes up to 100mm (4 diameter) or smaller. The system can anneal in N 2 and Forming gas

Voyage Recorder is an affordable, miniature black box for a yacht. A Digital Voyage data recorder (VDR) connected to the NMEA 2000 network on your boat serves to record and store boat data. It collects

Software for electronic scorekeeping of volleyball matches, developed and distributed by: Developed for the rules of USports 2017-18 As adopted by Ontario University Athletics for Men s & Women s Volleyball

Operating instructions for For visualization of your measurements FermVis operating instructions Important message In the interest of preventing operator errors and incorrect measurement results, you must

Fencing Time Version 4.3 Upgrading your Fencing Time Server October 2017 Copyright 2017 by Fencing Time, LLC. All rights reserved. Overview Periodically, a new version of Fencing Time is released. In most

The task on hand Level sensing as it is understood in modern process automation is much more than simply "tank half full" or "tank a quarter full". Using suitable sensors, levels, inlets and outlets can

TOURNAMENT MANUAL 6 months new year Club committee decides on date for and checks that it does not clash with any other s. Advise Forwords Editor and Webmaster via email of the date chosen and the venue.

CONTROL and INSTRUMENTATION COURSE 500: 5 DAYS: Max 8 Candidates This course covers the key aspects of current instrumentation and process control technology and is designed to enable maintenance personnel

AE2610 Introduction to Experimental Methods in Aerospace AERODYNAMIC FORCES ON A WING IN A SUBSONIC WIND TUNNEL Objectives The primary objective of this experiment is to familiarize the student with measurement

Purpose and Scope: This document describes the procedures and policies for using the MSE Bruker FTIR Spectrometer. The scope of this document is to establish user procedures. Instrument maintenance and

2009.1.6 Database of Winds and Waves -internet version- http://www.nmri.go.jp/wavedb/wave2.html National Maritime Research Institute CONTENTS 1. Outline of the Database... 1 2. Use of the Database on the

Balancing Theory Aim of balancing How an unbalance evolves An unbalance exists when the principle mass axis of a rotating body, the so-called axis of inertia, does not coincide with the rotational axis.

C054-0351 Over 80 years of experience in precision weighing and UniBloc technology The latest information on balances and scales is available at the following site: http://www.shimadzu.com/balance/ Registered

Shearwater GF Computer DANGER This computer is capable of calculating deco stop requirements. These calculations are at best a guess of the real physiological decompression requirements. Dives requiring