I am trying to have LEDs become interactive based on how the Wii Nunchuck is used.
For example, I would want to control the LEDs in a matrix with the accelerometer or display a pattern with the C and Z buttons on the Wii Nunchuck.
I was wondering if it would be possible to use interrupts to constantly check the status of the Nunchuck if the Nunchuck is connected to the analog pins A4 and A5?
I was wondering if it would be possible to use interrupts to constantly check the status of the Nunchuck if the Nunchuck is connected to the analog pins A4 and A5?
I don't know about using interrupts, but as the Nunchuck uses I2C protocol, you
can just use a standard I2C routine. I used the following sketch and it worked great
the first time.
Be sure to use ONLY 3.3V to power and interface to the Nunchuck - unfortunately
a little difficult to do if you have a 5V Arduino. I cut the funny connector off the
Nunchuck and just wired it in.
Would there be a way to be able to constantly read the data from the nunchuck in the background while the main program is going on?
I wonder because my main program requires to know the status of both the buttons and accelerometer of the nunchuck.
I do not want to use a polling method because the button presses would not be read on occasion.
Interrupts seem to be the best route, but from what I know, interrupts don't seem to work with I2C. Is there a way to implement the interrupt for the nunchuck?
I read the information in the previous post, but the previous post only shows how to read data without a main program going on simultaneously.