You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to read the data off the Nunchuk but failing...I feel like there's some initialization function that I'm not calling or something like that, because the sample scene works fine for me.
I always get the no nunchuck line printed, and wiimore.current_ext.ToString() is reported as NONE. AS far as I can tell, that is expected behaviour, as the nunchuck isn't even fully detected at this point; I don't see the An extension has been connected. debug message until after these messages are printed out.
Here's my code in my Update() method:
if (!WiimoteManager.HasWiimote()) { return; }
wiimote = WiimoteManager.Wiimotes[0];
int ret;
do {
ret = wiimote.ReadWiimoteData();
} while (ret > 0);
if (wiimote.current_ext == ExtensionController.NUNCHUCK) {
NunchuckData data = wiimote.Nunchuck;
print("got nunchuk!");
// Use nunchuck data
// ...
} else {
print(wiimote.current_ext.ToString());
}
In this case, I always drop into the else block, even after the "An extension has been connected" message is printed out.
I sprinkled in some debug statements in Wiimote.cs and noticed that in RespondIdentifyExtension, the val identifier has the hex value 0xFF00A4200000, which is almost the same as the value for ID_Nunchuck except the highest byte is FF instead of 00.
I'm not sure what is causing this. Am I missing an initialization function somewhere? Am I supposed to send some data to the wiimote before trying to read nunchuck data?
The text was updated successfully, but these errors were encountered:
I had to set the data report mode to REPORT_BUTTONS_ACCEL_EXT16 to get Nunchuck data from my controller.
By default I was only getting switch data back from just the Wiimote.
I think a better description of what data is returned for each InputDataType would help greatly.
I'm trying to read the data off the Nunchuk but failing...I feel like there's some initialization function that I'm not calling or something like that, because the sample scene works fine for me.
Here's my code to find the Wiimote:
I always get the
no nunchuck
line printed, andwiimore.current_ext.ToString()
is reported asNONE
. AS far as I can tell, that is expected behaviour, as the nunchuck isn't even fully detected at this point; I don't see theAn extension has been connected.
debug message until after these messages are printed out.Here's my code in my Update() method:
In this case, I always drop into the
else
block, even after the "An extension has been connected" message is printed out.I sprinkled in some debug statements in
Wiimote.cs
and noticed that inRespondIdentifyExtension
, theval
identifier has the hex value0xFF00A4200000
, which is almost the same as the value forID_Nunchuck
except the highest byte isFF
instead of00
.I'm not sure what is causing this. Am I missing an initialization function somewhere? Am I supposed to send some data to the wiimote before trying to read nunchuck data?
The text was updated successfully, but these errors were encountered: