Hardware Reference
In-Depth Information
Testing ./nunchuk
When you want to see what Nunchuk data is being received, you can add the
-d command-line option:
$ ./nunchuk −d
Raw nunchuk data: [83] [83] [5C] [89] [A2] [63]
.stick_x = 0083 (131)
.stick_y = 0083 (131)
.accel_x = 0170 (368)
.accel_y = 0226 (550)
.accel_z = 0289 (649)
.z_button= 0
.c_button= 0
The first line reports the raw bytes of data that were received. The remainder of the
lines report the data in its decoded form. While the raw data reports the button presses as
active low, the Z and C buttons are reported as 1 in the decoded data. The value in the left
column is in hexadecimal format, while the value in parenthesis is shown in decimal.
Utility lsinputs
When the Nunchuk program is running, you should be able to see the Nunchuk uinput
device in the list:
$ lsinput
...
/dev/input/event2
bustype : BUS_USB
vendor : 0x45e
product : 0x40
version : 272
name : "Microsoft Micro soft 3−Button Mou"
phys : "usb−bcm2708_usb−1.3.4/input0"
uniq : ""
bitsev : EV_SYN EV_KEY EV_REL EV_MSC
/dev/input/event3
bustype : BUS_USB
vendor : 0x1
product : 0x1
version : 1
name : "nunchuk"
bits ev : EV_SYN EV_KEY EV_REL
In this example, the Nunchuk shows up as event3 .
 
Search WWH ::




Custom Search