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

Similar documents
WiiMaze Design Document March 13, 2008

Oxygen Meter User Manual

Wiimote Visualization Through Particles

Getting Started with the LabVIEW Toolkit for LEGO MINDSTORMS NXT

Quintic Automatic Putting Report

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.

Software Manual for FITstep Pro Version 2

Using the Lego NXT with Labview.

Mac Software Manual for FITstep Pro Version 2

FireHawk M7 Interface Module Software Instructions OPERATION AND INSTRUCTIONS

Microsoft Windows Software Manual for FITstep Stream Version 4

The NXT Generation. A complete learning solution

Version 3.1.0: New Features/Improvements: Improved Bluetooth connection on Windows 10

4 Making Your Robot Move

Instruction Manual. BZ7002 Calibration Software BE

ZIPWAKE DYNAMIC TRIM CONTROL SYSTEM OUTLINE OF OPERATING PRINCIPLES BEHIND THE AUTOMATIC MOTION CONTROL FEATURES

User Guide. Two-Wheeled Add-on. Created By: A-Lab Software Limited. Date Created: Feb Date Modified: Feb Revision: 1.

Courseware Sample F0

HumiSys HF High Flow RH Generator

Previous Release Notes

Viva TPS. TS11/15 Total Stations Check and Adjust Procedure. October Summary

Setting up the Ingenico isc250 Pinpad via USB in Windows 8

Instrument pucks. Copyright MBARI Michael Risi SIAM design review November 17, 2003

The HumiSys. RH Generator. Operation. Applications. Designed, built, and supported by InstruQuest Inc.

MoLE Gas Laws Activities

Lab 1c Isentropic Blow-down Process and Discharge Coefficient

XC2 Client/Server Installation & Configuration

Cover Page for Lab Report Group Portion. Head Losses in Pipes

NATIONAL UNIVERSITY OF SINGAPORE. EE3302/EE3302E Industrial Control Systems E1: ADVANCED CONTROL SYSTEMS

2600T Series Pressure Transmitters Plugged Impulse Line Detection Diagnostic. Pressure Measurement Engineered solutions for all applications

Lab 4: Root Locus Based Control Design

SIDRA INTERSECTION 6.1 UPDATE HISTORY

ACCURATE PRESSURE MEASUREMENT FOR STEAM TURBINE PERFORMANCE TESTING

Programmable Submersible Level Transmitters

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

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

SHIMADZU LC-10/20 PUMP

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

SpeedMax White Paper. Dynastream Innovations Inc. 228 River Avenue Cochrane, AB T4C 2C1. p f

v2.3 USER MANUAL

User manual CF8-D/W-IN

APA software instruction manual

Code Basic module and level control complete with optionals code

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

ACTIVITY MONITORING SYSTEM

TR Electronic Pressure Regulator. User s Manual

Quadruple mass spectrometers (transducer type)

Programmable pressure and temperature transmitters PTM/RS485

Sorensen DCS Series. 1 3 kw V A. General Purpose Systems Power Supply

In addition to reading this assignment, also read Appendices A and B.

Fencing Time Version 4.3

User Manual. asense VAV. CO 2 / temperature sensor with built-in general purpose controller

UNIVERSITY OF WATERLOO

DST Host User Manual

S-CURVE DOCUMENTATION AND TUTORIAL FOR THE S-CURVE ON THE COOL MUSCLE

Setting Up the Ingenico isc250 Pinpad via USB

Programmable pressure and temperature transmitters PTM/RS485

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

Deploying the TCM-1 Tilt Current Meter in an Inverted (Hanging) Orientation By: Nick Lowell, Founder & President

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

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

Wiimote in Physical Etoys

Long term stability tests of INO RPC prototypes

CF8-W-Disp-CO. User manual. CO 2 / CO sensor with built-in general purpose controller

Parametrable / Programmable Pressure Transmitter

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

MoLE Gas Laws Activities

Kestrel HVK Gun Loader Sofware

Hardware Triaxial and Consolidation Testing Systems Pressure Measurement and Control

Drift-Chamber Gas System Controls Development for the CEBAF Large Acceptance Spectrometer

Datalogging Shirt for Baseball Pitchers

Lab 1: Pressure and surface tension. Bubblers, gravity and the mighty paper clip.

COST-EFFECTIVE WIIMOTE-BASED TECHNOLOGY- ENHANCED TEACHING AND LEARNING PLATFORM

Sensoric 4-20 ma Transmitter Board Operation Manual

Flexible Software for Computer-Based Problem Solving Labs

Technology. Using Bluetooth

Pneumatic high-pressure controller Model CPC7000

SCHEINWORKS Measuring and Analysis Systems by

SSI Solaris 150 RTA Revision /27/2016 Page 1 of 9. SSI Solaris 150 RTA

Towards determining absolute velocity of freestyle swimming using 3-axis accelerometers

AMS 6915 Board mount pressure sensor with digital output (I²C)

Ranging and Communications Module Reconfiguration and Evaluation Tool (RCM RET) User Guide

Electronic gas volume corrector model DGVC-04

ELIMINATOR COMPETITION DRAG RACE Program Manual Firm Ver 4.11

INSTALLATION INSTRUCTIONS AND REFERENCE HANDBOOK

SQL LiteSpeed 3.0 Installation Guide

Users Guide for the CableSoft Software Package

D-Opto Dissolved Oxygen Sensor Operation Manual

HASTAC High stability Altimeter SysTem for Air data Computers

BASIC Z-STACK AND TIME SERIES SCAN ON THE ZEISS LIGHTSHEET Z. 1

USER MANUAL. Intelligent Diagnostic Controller IDC24-A IDC24-AF IDC24-AFL IDC24-F IDP24-A * IDP24-AF * IDP24-AFL * IDP24-F * 1/73

Figure 2. Auxiliary table

EasySas. The most advanced airlock electronics on the market. Recyclable product. Eco-design. Energy savings

Blackwave Dive Table Creator User Guide

Project Title: Pneumatic Exercise Machine

DDR Dive Data Recorder Manual - Rel /12

These Terms and conditions apply to audit trails incorporated in weighing and measuring devices and systems 1.

Operating Instructions EB EN. Series 373x Electropneumatic Positioner Type 373x-5 EXPERT + with FOUNDATION fieldbus communication

Using MATLAB with CANoe

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

Transcription:

Laboratory 2(a): Interfacing WiiMote Authors: Jeff C. Jensen (National Instruments) Trung N. Tran (National Instruments) Instructors: Edward A. Lee Sanjit A. Seshia University of California, Berkeley EECS 149 February 10, 2011

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) 7.2.4 Fixed-Point Numbers, pp. 197-199. 2. 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 2010. 2 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

Figure 1: Nintendo WiiMote Figure 2: Nintendo WiiMote microcontroller exposed. 2

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

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 1.03. Berkeley, California, 2010. Available: http://leeseshia.org/releases/leeseshia_ DigitalV1_03.pdf. [Accessed January 25 th, 2011]. [2] Ian Rickard, Wiimote website. Available: http://homepage.mac.com/ianrickard/wiimote/wiili_ wimote.html. [Accessed January 30 th, 2011]. 4

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 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