Line 312:
Line 312:
Most of these are also mirrored across the high bits of the individual peripheral. For example, the second byte of the address is ignored in the Extension controller address, which means any address of the form 0xA4xx00 will work (as will 0xA5xx00).
Most of these are also mirrored across the high bits of the individual peripheral. For example, the second byte of the address is ignored in the Extension controller address, which means any address of the form 0xA4xx00 will work (as will 0xA5xx00).
−
= Input Features =
+
= Input features =
−
The Wii Remote has two input features that are controlled directly by the Broadcom chip: a [[#Accelerometer | Three-Axis Accelerometer]] and 11 [[#Buttons | Buttons]]. Additionally, it has an [[#IR Camera | IR Camera]] with an object tracking processor, and an expansion port that allows for external input features such as those contained in the Nunchuk and the Classic Controller (see [[#Extension Controllers | Extension Controllers]]).
+
See [[/Input features]].
−
−
== Buttons ==
−
The Wii Remote has 11 buttons on its front face, and one trigger-style button on the back. Of these, the Power button is special and is treated differently by the Wii Remote. All the other buttons are independantly accessible through a two-byte bitmask which is transmitted first in most Input Reports. A button will report a 1-bit if pressed, or a 0-bit otherwise. By default, these are sent only when the state of any button changes, in [[#0x30: Core Buttons | Data Reporting Mode 0x30]]. However, the Wii Remote may be configured to report the state of the buttons continuously; see [[#Data Reporting | Data Reporting]].
−
−
=== Core Buttons ===
−
The Wii Remote has 11 buttons that are used as regular input devices: A, B (trigger), a 4-directional D-Pad, +, -, Home, 1, and 2. These are reported as bits in a two-byte bitmask. These are the assignments, in big-endian order:
−
{| style="border: 1px solid #bbb; border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
−
|- style="background-color: #ddd;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | '''Bit'''
−
| style="border: 1px solid #ccc; padding: 0.2em;" | '''Mask'''
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | '''First Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | '''Second Byte'''
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x01
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | D-Pad Left
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Two
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x02
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | D-Pad Right
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | One
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 2
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x04
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | D-Pad Down
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | B
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 3
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x08
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | D-Pad Up
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | A
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 4
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x10
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | Plus
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Minus
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 5
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x20
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded; color: #888" | Other uses
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde; color: #888" | Other uses
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 6
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x40
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded; color: #888" | Other uses
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde; color: #888" | Other uses
−
|- style="background-color: #eee;"
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 7
−
| style="border: 1px solid #ccc; padding: 0.2em;" | 0x80
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded; color: #888" | Unknown
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | Home
−
|}
−
−
=== Power Button ===
−
When the Wii Remote is turned off, pressing the Power button will attempt to wake up the Wii that is synchronized to it. The mechanism for this is unknown, and it is handled entirely within the Wii's bluetooth module. When the Wii Remote is turned on and connected to a host, pressing and holding the Power button for a few seconds will turn the Wii Remote off and request disconnection from the host. The disconnection reason included with the Baseband (ACL) disconnection request indicates that the power button was pressed: REMOTE DEVICE TERMINATED CONNECTION DUE TO POWER OFF (0x15). Another possible value is REMOTE DEVICE TERMINATED CONNECTION DUE TO LOW RESOURCES (0x14), which indicates that the Wii Remote performed a controlled shut down due to a low battery condition.
−
−
=== Sync Button ===
−
The sync button is hidden under the battery cover. When the Sync button is pressed, the Wii remote will disconnect from whatever it is currently connected to, make itself discoverable, and accept pairing or connection requests for exactly 20 seconds (regardless of how long the button is held down for).
−
−
The "syncing" of a Wii Remote involves standard Bluetooth pairing. When the Sync button is pressed on the remote, it will accept pairing requests. The required PIN is the hosts's Bluetooth address, backwards (last byte first), in binary (6 bytes). Most current Bluetooth implementations don't deal with this correctly, as they usually consider the PIN to be a regular null-terminated ASCII string (no 00 bytes, etc) and most Bluetooth addresses will contain null bytes. Any further steps that need to be taken after the Wii Remote is paired have not been reverse engineered yet.
−
−
Once the Wii Remote is synced, when a button is pressed, it will actively seek out its paired host and try to connect to it, instead of the other way around. Establishing a connection can be done on PSM 0x11 for writing and PSM 0x13 for reading using the Bluetooth L2CAP protocol.
−
−
=== Button Hardware ===
−
−
The physical hardware of the buttons varies: there are membrane switches and microswitch click buttons. There has been some success soldering wires to the membrane switch contacts and actuating the switch through an external switch. The following table describes the physical hardware for each input.
−
−
{| class="wikitable" border="1"
−
|-
−
! Function
−
! Switch type
−
! Circuit board surface
−
|-
−
| A
−
| [http://en.wikipedia.org/wiki/Membrane_switch membrane]
−
| top, SW9
−
|-
−
| B
−
| membrane
−
| bottom, SW8
−
|-
−
| -
−
| [http://en.wikipedia.org/wiki/Microswitch microswitch]
−
| top, SW10
−
|-
−
| Home
−
| microswitch
−
| top, SW11
−
|-
−
| +
−
| microswitch
−
| top, SW5
−
|-
−
| 1
−
| membrane
−
| top, SW7
−
|-
−
| 2
−
| membrane
−
| top, SW6
−
|-
−
| Up
−
| membrane
−
| top, SW4
−
|-
−
| Down
−
| membrane
−
| top, SW3
−
|-
−
| Left
−
| membrane
−
| top, SW1
−
|-
−
| Right
−
| membrane
−
| top, SW2
−
|-
−
| Sync
−
|
−
| bottom, SW12
−
|-
−
| Power
−
|
−
| top, SW13
−
|}
−
−
== Accelerometer ==
−
[[File:Wii-Remote-Accel.jpg|right|thumb|200px|ADXL330 in a Wii remote]][[File:Wiimote_axis2.png|right|thumb|200px|Coordinate system used by Wii Remote]]
−
The Wii Remote includes a three-axis linear accelerometer located on the top suface of the circuit board, slightly left of the large A button. The integrated circuit is the [http://www.seekic.com/icdata/%20ADXL330.html ADXL330] ([http://www.analog.com/UploadedFiles/Data_Sheets/ADXL330.pdf data sheet]), manufactured by Analog Devices. This device is physically rated to measure accelerations over a range of at least +/- 3g with 10% sensitivity.
−
−
Since the accelerometer actually measures the force exerted by a set of small proof masses inside of it with respect to its enclosure, the accelerometer measures linear acceleration in a free fall frame of reference. If the Wii Remote is in free fall, it will report zero acceleration. At rest, it will report an upward acceleration (+Z, when horizontal) equal to the acceleration due to gravity, g (approximately 9.8 m/s²) but in the opposite direction. This fact can be used to derive tilt from the acceleration outputs when the Wii Remote is reasonably still.
−
−
=== Normal Accelerometer Reporting ===
−
In all [[#Data Reporting | Data Reporting Modes]] which include Accelerometer data except for [[#0x3e / 0x3f: Interleaved Core Buttons and Accelerometer with 36 IR bytes | mode 0x3e/0x3f]], the accelerometer data is reported as three consecutive bytes:
−
−
(a1) RR BB BB XX YY ZZ [...]
−
−
XX, YY, and ZZ are unsigned bytes representing the acceleration in each of the three axis, where zero acceleration is approximately 0x80. The coordinate system is shown in the diagram above (note that this is different from the coordinate system used by GlovePIE). Additionally, the BB BB [[#Buttons | Buttons]] bytes also include the LSBs of the acceleration values in the unused bits, according to the following table:
−
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em; text-align: center;"
−
|- style="background-color: #ddd;"
−
| style="background-color: #fff;" colspan="2" |
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="8"| '''Bit'''
−
|- style="background-color: #cdc;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''7'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''6'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''5'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''4'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''3'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''0'''
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''X'''<span style="color: #777;"><<span style="color: #c00;">1:0</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" | '''Z'''<span style="color: #777;"><<span style="color: #c00;">1</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" | '''Y'''<span style="color: #777;"><<span style="color: #c00;">1</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|}
−
−
Note that X has 10 bits of precision, while Y and Z only have 9. For consistency, they are assumed all to have a 10-bit range and the LSB is always set to zero for Y and Z.
−
−
=== Interleaved Accelerometer Reporting ===
−
In [[#0x3e / 0x3f: Interleaved Core Buttons and Accelerometer with 36 IR bytes | Data Reporting Mode 0x3e/0x3f]], the accelerometer data is spread over two reports:
−
−
(a1) 3e BB BB XX [...]
−
(a1) 3f BB BB YY [...]
−
−
In this mode, the LSBs are not available. Instead, X and Y acceleration is reported as a single byte, and the Z value is encoded in the unused bits of the BB BB [[#Buttons | Buttons]] data as follows:
−
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em; text-align: center;"
−
|- style="background-color: #ddd;"
−
| style="background-color: #fff;" colspan="2" |
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="8"| '''Bit'''
−
|- style="background-color: #cdc;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Report ID'''
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''7'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''6'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''5'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''4'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''3'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''0'''
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0x3e
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Z'''<span style="color: #777;"><<span style="color: #c00;">5:4</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0x3e
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Z'''<span style="color: #777;"><<span style="color: #c00;">7:6</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0x3f
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Z'''<span style="color: #777;"><<span style="color: #c00;">1:0</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0x3f
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" |
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Z'''<span style="color: #777;"><<span style="color: #c00;">3:2</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="5" |
−
|}
−
−
== IR Camera ==
−
[[File:Wii-Remote-Camera.jpg|200px|thumb|right|Wii remote camera]] The Wii Remote includes a 128x96 monochrome camera with built-in image processing. The camera looks through an infrared pass filter in the remote's plastic casing. The camera's built-in image processing is capable of tracking up to 4 moving objects, and these data are the only data available to the host. Raw pixel data is not available to the host, so the camera cannot be used to take a conventional picture. The built-in processor uses 8x subpixel analysis to provide 1024x768 resolution for the tracked points. The Sensor Bar that comes with the Wii includes two IR LED clusters at each end, which are tracked by the Wii Remote to provide pointing information. The distance between the centers of the LED clusters is 20 cm (as measured on one unit).
−
−
The IR Camera is enabled by setting bit 2 on output reports 0x13 and 0x1a:
−
(a2) 13 04
−
(a2) 1a 04
−
−
The first enables a 24MHz pixel clock on pin 7 of the camera. The second pulls pin 4 low - probably an active-low enable.
−
−
=== Mechanical Characteristics ===
−
−
The camera component is mounted on the bottom surface of the circuit board. The camera module itself is mounted in a socket perpendicular to the circuit board; to remove just the camera module, no desoldering is required. The process is as follows:
−
−
First, orient the camera so that you are looking into the lens with the PCB horizontal and below the lens.. There are four metal clips, two on each of the
−
vertical sides of the socket. Use something tiny to slide between each metal clip and the camera module: maybe wire wrap wire? Then look at the back of the camera module, opposite the lens. There is a small rectangular hole in the middle of each vertical side of the socket. Use a pin or something to pry/press the camera module out.
−
−
Once the camera module is free of its socket, it may be further disassembled by gently prising up the tiny PCB with gold contacts; this is gently glued to the module's structure, but will come loose without damage. At this point you have three pieces: the camera socket, still attached to the Wiimote PCB, the camera module housing, complete with lens and dichroic filter (of unknown optical properties), and a tiny PCB with the camera chip and eight gold contacts on the bottom.
−
−
=== Optical Characteristics ===
−
−
The IR camera has an effective field of view is about 33 degrees horizontally and 23 degrees vertically (as measured on one unit). With the IR-pass filter intact, 940nm sources are detected with approximately twice the intensity of equivalent 850nm sources, but are not resolved as well at close distances. If the filter is removed, it can track any bright object. However, the IR filter referred to here is not only the dark plastic window of the wiimote but also a teensy slab of dichroic-coated glass inside the camera module. One may operate the wiimote having installed neither, one or the other, or both filters.
−
−
=== Initialization ===
−
−
{{BoxCenter|'''Reminder'''<br />Remember to set bit 2 (0x04) on the first byte of the Output Reports to write to registers!}}
−
−
The following procedure should be followed to turn on the IR Camera:
−
−
#Enable IR Camera (Send 0x04 to Output Report 0x13)
−
#Enable IR Camera 2 (Send 0x04 to Output Report 0x1a)
−
#Write 0x08 to register 0xb00030
−
#Write Sensitivity Block 1 to registers at 0xb00000
−
#Write Sensitivity Block 2 to registers at 0xb0001a
−
#Write Mode Number to register 0xb00033
−
#Write 0x08 to register 0xb00030 (again)
−
−
After these steps, the Wii Remote will be in one of 3 states: IR camera on but not taking data, IR camera on and taking data and half sensitivity, IR camera on and taking data at full sensitivity. Which state you end up in appears to be pretty much random. Repeat the steps until you're in the desired state. To avoid the random state put a delay of at least 50ms between every single byte transmission.
−
−
The Wii preforms these steps slightly different, differences in bold:
−
#Enable IR Pixel Clock (send '''0x06''' to Output Report 0x13)
−
#Enable IR Logic (send '''0x06''' to Output Report 0x1A)
−
#Write '''0x01''' to register 0xb00030
−
#Write Sensitivity Block 1 to registers at 0xb00000
−
#Write Sensitivity Block 2 to registers at 0xb0001a
−
#Write Mode Number to register 0xb00033
−
#Write 0x08 to register 0xb00030 (again)
−
−
Adding bit 0x02 to reports 0x13 and 0x1a is a request for acknowledgement (if set, wiimote will respond with report 0x22).
−
−
=== Sensitivity Settings ===
−
Sensitivity is controlled by two configuration blocks, 9 bytes and 2 bytes long. The following settings are known to work:
−
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ded;" | '''Block 1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #dde;" | '''Block 2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Notes'''
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 00 00 00 00 00 00 90 00 C0
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 40 00
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Suggested by [[User:Marcan | Marcan]]
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 00 00 00 00 00 00 FF 00 0C
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 00 00
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Suggested by Kestrel (max sensitivity)
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 00 00 00 00 00 00 90 00 41
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 40 00
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Suggested by inio (high sensitivity)
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 02 00 00 71 01 00 64 00 fe
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | fd 05
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Wii level 1
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 02 00 00 71 01 00 96 00 b4
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | b3 04
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Wii level 2
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 02 00 00 71 01 00 aa 00 64
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 63 03
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Wii level 3 (Suggested by Cliff)
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 02 00 00 71 01 00 c8 00 36
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 35 03
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Wii level 4
−
|- style="text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #efe; font-family: monospace;" | 07 00 00 71 01 00 72 00 20
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eef; font-family: monospace;" | 1f 03
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee; text-align: left;" | Wii level 5
−
|}
−
−
The last byte of Block 1 determines the intensity sensitivity, with increasing values reducing the sensitivity. Both bytes of Block 2 must be zero for the full sensitivity range to be available. Setting the sensitivity as high as possible, without unwanted light being tracked, is recommended to achieve the highest subpixel resolution. As the sensitivity is reduced, the subpixel resolution also reduces, approaching the true sensor resolution of 128x96.
−
−
=== Data Formats ===
−
The IR Camera can return different sets of data describing the objects it is tracking. When the IR camera identifies an object, it assigns it to the first available object slot. If an object moves out of view, its slot is marked as empty (returns 0xFF data), but other objects retain their slots. For example, if the camera is tracking two objects and the first moves out of view, the data returned will be [empty, second object, empty, empty]. With more than four objects visible, the camera is prone to rapidly switching between some of them. This could allow perception of more than four objects, at a reduced response speed and reliability.
−
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
−
|- style="background-color: #dde; text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | '''Mode'''
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center; background-color: #ded;" | '''Mode Number'''
−
|- style="background-color: #eef; text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | [[#Basic Mode | Basic]]
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center; background-color: #efe;" | 1
−
|- style="background-color: #eef; text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | [[#Extended Mode | Extended]]
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center; background-color: #efe;" | 3
−
|- style="background-color: #eef; text-align: center;"
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" | [[#Full Mode | Full]]
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center; background-color: #efe;" | 5
−
|}
−
−
The data format MUST match the number of bytes available in the [[#Data Reporting | Reporting Mode]] selected. Even choosing a mode with space for more bytes than necessary will not work, it has to be an exact match.
−
−
==== Basic Mode ====
−
In Basic Mode, the IR Camera returns 10 bytes of data corresponding to the X and Y locations of each of the four dots. Each location is encoded in 10 bits and has a range of 0-1023 for the X dimension, and 0-767 for the Y dimension. Each pair of dots is packed into 5 bytes, and two of these are transmitted for a total of 4 dots and 10 bytes.
−
−
This is the data format for a pair of objects:
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em; text-align: center;"
−
|- style="background-color: #ddd;"
−
| style="background-color: #fff;" |
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="8"| '''Bit'''
−
|- style="background-color: #cdc;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''7'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''6'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''5'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''4'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''3'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''0'''
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''X1'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''Y1'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 2
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Y1'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''X1'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Y2'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''X2'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 3
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''X2'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 4
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''Y2'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|}
−
−
==== Extended Mode ====
−
In Extended Mode, the IR Camera returns the same data as it does in Basic Mode, plus a rough size value for each object. The data is returned as 12 bytes, three bytes per object. Size has a range of 0-15.
−
−
This is the data format for each object:
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em; text-align: center;"
−
|- style="background-color: #ddd;"
−
| style="background-color: #fff;" |
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="8"| '''Bit'''
−
|- style="background-color: #cdc;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''7'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''6'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''5'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''4'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''3'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''0'''
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''X'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''Y'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 2
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Y'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''X'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="4" | '''S'''<span style="color: #777;"><<span style="color: #c00;">3:0</span>></span>
−
|}
−
−
==== Full Mode ====
−
In Full Mode, the IR Camera returns even more data, 9 bytes per object for a total of 36 bytes for all four. The data is split up between two input reports of 18 bytes each (see [[#0x3e / 0x3f: Interleaved Core Buttons and Accelerometer with 36 IR bytes | Data Reporting Mode 0x3e/0x3f]]). The first three bytes of each object are the same as the extended mode, and are followed by the bounding box of the pixels included in the blob along with a deeper intensity value. The data format of each object is:
−
−
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em; text-align: center;"
−
|- style="background-color: #ddd;"
−
| style="background-color: #fff;" |
−
| style="border: 1px solid #ccc; padding: 0.2em; text-align: center;" colspan="8"| '''Bit'''
−
|- style="background-color: #cdc;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | '''Byte'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''7'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''6'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''5'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''4'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''3'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''2'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''1'''
−
| style="border: 1px solid #ccc; padding: 0.2em; width:2em;" | '''0'''
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''X'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 1
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''Y'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 2
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''Y'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="2" | '''X'''<span style="color: #777;"><<span style="color: #c00;">9:8</span>></span>
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="4" | '''S'''<span style="color: #777;"><<span style="color: #c00;">3:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 3
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="7" | '''X min'''<span style="color: #777;"><<span style="color: #c00;">6:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 4
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="7" | '''Y min'''<span style="color: #777;"><<span style="color: #c00;">6:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 5
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="7" | '''X max'''<span style="color: #777;"><<span style="color: #c00;">6:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 6
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" | 0
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="7" | '''Y max'''<span style="color: #777;"><<span style="color: #c00;">6:0</span>></span>
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 7
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;" colspan="8" | 0
−
|- style="background-color: #ded;"
−
| style="border: 1px solid #ccc; padding: 0.2em; background-color: #eee;" | 8
−
| style="border: 1px solid #ccc; padding: 0.2em;" colspan="8" | '''Intensity'''<span style="color: #777;"><<span style="color: #c00;">7:0</span>></span>
−
|}
= Feedback Features =
= Feedback Features =