Game Development Reference
In-Depth Information
The response to this report by the Wiimote should be an array of 8 bytes representing
a1 20 BB BB LF 00 00 VV
The first byte (0xa1) is the report type (Input in this case).
Bytes 3 and 4 (BB BB) contain information about the core buttons
(see Table 8-3 ).
Byte 5 (LF): L is the most significant bit of byte 5, representing the LED
state; F is the least significant bit of byte 5, representing a bitmask of
flags indicating whether the battery is flat or whether an expansion is
currently connected.
Byte 8 (VV) represents battery level (a value between 0 and 100).
Bytes 2, 6, and 7 don't contain pertinent information and can be
ignored.
Button Status
Information about the core buttons of the Wiimote is encoded as bits in a two-byte bitmask
described in Table 8-3 .
Table 8-3. Core Buttons of the Wiimote
Bit
Mask
First Byte
Second Byte
0
0x01
D-Pad Left
Two
1
0x02
D-Pad Right
One
2
0x04
D-Pad Down
B
3
0x08
D-Pad Up
A
4
0x10
Plus
Minus
5
0x20
Other uses
Other uses
6
0x40
Other uses
Other uses
7
0x80
Unknown
Home
Player LEDs
These are the four lights in the front face of the Wiimote. During discovery and before
initialization, these LEDs blink at a fixed rate. During gameplay with the Wii, one LED is
lit to indicate the player number assigned to the Wiimote. This process can be controlled
programmatically by sending the following report through the Data Pipe
a2 11 LL
where 0xa2 indicates an output report, 0x11 the report type (set LED), and LL represents the
LED you wish to turn on (see Table 8-4 ).
 
 
Search WWH ::




Custom Search