Has anyone ever used the Wii Nunchuk as an input device or sensor for the Axoloti Core? If so, where might I find the code and/or details? If not, how would one best approach creating the interface to make this happen?
Thanks for your time.
Has anyone ever used the Wii Nunchuk as an input device or sensor for the Axoloti Core? If so, where might I find the code and/or details? If not, how would one best approach creating the interface to make this happen?
Thanks for your time.
Don't think anyone has done that before. Connecting the Wii Nunchuk should be the same as you would do with the Arduino: http://www.clockwork-evolution.com/electronics/arduino-nunchuck-project/. You'll need the GND, VDD (3.3 Volt) and two analog ports on the Axoloti. Documentation on the Axoloti ports can be found here: https://sebiik.github.io/community.axoloti.com.backup/t/official-pin-out-ports-documentation/202/5
The tricky thing will be writing the code to make some sense from the output of the Wii Nunchuk, since it has multiple sensors and they all send out some data. Take a look at the Arduino code: https://github.com/GabrielBianconi/ArduinoNunchuk/blob/master/ArduinoNunchuk/ArduinoNunchuk.cpp. Looks like the Wii Nunchuck sends out the values of all its sensors at once, and you need to do some bit shifting to get the values you need.
What if I set up an attiny85 to communicate with the nunchuk and extract the values, then establish communication between the Axoloti Core and the attiny85? Or is that needless complication?
I think it's needless complication as well. You only need 2 ports + VDD and GND to connect the nunchuk to the Axoloti, same for the attiny85. If you want to send each value over separately from the attiny85 to the Axoloti, you would have to use more than double of that.
Best way is to just figure out how to port the code from Arduino to Axoloti, so you could add two nunchuk controllers at the same time and have space left for extra sensors.
Why analog? The Nunchuk communicates using I2C.
Some of the Arduino examples work only with the genuine Nintento Nunchuks if they use the "old way" of initializing the Nunchuk. http://wiibrew.org/wiki/Wiimote/Extension_Controllers#The_Old_Way
I2C is the way to go for sure.
You can find some patches here https://github.com/axoloti/axoloti/tree/5c06f2b13c0802226855beac4bec14bac7b6ce8c/archive/tests/io that could be inspiring.