small medium large xlarge

Back to: All Forums  Arduino
05 Sep 2012, 03:46
Ade Oduye (10 posts)


I just finished inputting all the code for chapter 7 and found that while processing creates a squared shape on a black background, the program is un-responsive to my nunchuk controls.

I was getting all the necessary axis details from the earlier example and have not altered the arduinos connection with the nunchuk. The only thing that has changed is the code I am running.

Can you please give any hints why the code is not responding to the nunchuk or perhaps how I can test that the nunchuk is even recognised by the code? Any hints at all, please … ?

09 Sep 2012, 12:05
Maik Schmidt (120 posts)

Did you also try to download the source code of the Cube demo from the book’s web site?

21 Jun 2013, 09:42
Arwa Abdulkarim (1 post)

I had the same problem, I have few minor changes to the code (probably something that works better with my machine)

added the last line in this snippet for (Cube.pde)

 arduinoPort = new Serial(this,Serial.list()[0],BUAD_RATE);

used “new line” to separate the data collected from Nunchuk, and added Serial.print(‘\n’); at the end of the loop.

 final String arduinoData = port.readStringUntil('\n');

and replaced the Hex numbers with the actual numbers I got from my Nunchuk when testing in in the ino sketch.

xpos = int(map(data[0], 24, 236,0,WIDTH));
ypos = int(map(data[1], 20, 222, HEIGHT, 0));

but Awesome book Thanks Maik !