Hardware Reference
In-Depth Information
Chapter 3
Nunchuk-Mouse
This chapter's project is about attaching the Nintendo Wii Nunchuk to the Raspberry Pi.
The Nunchuk has two buttons; an X-Y joystick; and an X, Y, and Z accelerometer. The
sensor data is communicated through the I2C bus. Let's have some fun using a Nunchuk
as a pointing device for the X Window System desktop.
Project Overview
The challenge before us breaks down into two overall categories:
The I2C data communication details of the Nunchuk device
Inserting the sensed data into the X Window System desktop
event queue
Since you've mastered I2C communications in other parts of this topic, we'll focus
more on the Nunchuk technical details. The remainder of the chapter looks at the Linux
uinput API that will be used for the X-Windows interface. The final details cover a small
but critical X-Windows configuration change, to bring about the Nunchuk-Mouse.
Nunchuk Features
The basic physical and data characteristics of the Nunchuk are listed in Table 3-1 . 50
Table 3-1. Nunchuk Controls and Data Characteristics
User-Interface Features
Bits
Data
Hardware/Chip
C Button
1
Boolean
Membrane switch
Z button
1
Boolean
Membrane switch
X-Y joystick
8x2
Integers
30 k W potentiometers
X, Y, and Z accelerometer
10x3
Integers
ST LIS3L02 series
 
 
Search WWH ::




Custom Search