Page 1 of 1

New Flowcode Wii nunchuck component.

Posted: Thu Aug 27, 2020 3:40 pm
by medelec35
The nunchuck controller has been added to Flowcode v8 components.
You will need to use Help, check for updates after loaded the attached file.
Finish by selecting the Reload icon.

Wii nunchuck has the following features:
• Standard I2C interface.
• 3-axis accelerometer with. 10-bit accuracy.
• 2-axis analog joystick with. 8-bit A/D converter.
• 2 buttons
I have just created a nunchuk tester, so you can see if all is working or not.

Hardware:
Nintendo Wii knunchuck controller
Keyes1 Wii chuck Kduino1 PCB adaptor for plugging in to nunchuck connector.
BL0080 Eblocks2 PIC multiprogrammer with PIC16F18877.
BL0169 Eblocks2 Alphanumeric LCD board 20x4 plugged in to D port of PIC multiprogrammer.
Solderless breadboard for PCB adaptor.
BL0161 Eblocks2 patch board plugged in to C port of PIC multiprogrammer.
DuPont jumper leads.
Of course this should work with any hardware as also tested with Arduino UNO.

PCB adaptor connections.
- to GND of PIC multiprogrammer.
+ to 3V3 of PIC multiprogrammer. Warning: Do not connect to 5V.
d to 0 of patch board (d = SDA).
c to 1 patch board (c = SCL).

Only the genuine nunchuck has currently been tested.
Will test the very cheap version (ranging from £2 on wards) as soon as received them.

When running the hardware, if all is working you should see this:
LCD 20x4 nun1.png
LCD 20x4 nun1.png (136.52 KiB) Viewed 9869 times
Of course values will depend on the the orientation, joy position and if buttons pressed or not.
I will be easy to add LED's that change brighness and flashing rate by using accelerometer & joystick etc.

The 4x20 LCD can easily be swapped with UART component.

Let me know if you try this and face any issues.

Re: New Flowcode Wii nunchuck component.

Posted: Thu Aug 27, 2020 6:10 pm
by mnf
Thanks. That looks very cool.. A trip to the loft/charity shop to try and find a set....

Martin

Re: New Flowcode Wii nunchuck component.

Posted: Thu Aug 27, 2020 6:28 pm
by medelec35
Hi Martin, thank you.
I was thinking of getting a nunchucker controller, removing PCB & just making an electronic sprint level that works in X and Y directions.
Just ordered 2 for £9.99, but also read you can get them from the pound stores.

Re: New Flowcode Wii nunchuck component.

Posted: Fri Aug 28, 2020 2:57 pm
by medelec35
Good new is budget Chinese wii nunchucks arrived today.
All working as expected.
Its easier to remove PCB and cable if required, since it uses philips screws.
Original Nintendo uses triwing screws.

Re: New Flowcode Wii nunchuck component.

Posted: Tue Sep 01, 2020 6:12 pm
by stefan.erni
Hi Martin

It's a nice idea to use the wii nunchuck.
To connect it's also simple. I just shoped a small print.
I changed few line for an another display and it's working fine (in software mode) with the both switch
but not with the Accelerometer and Joystick. In the simulation everything looks fine.
Maybe it's more a PIC32 I2C problem.

regards
Stefan

Adapter.PNG
Adapter.PNG (242.65 KiB) Viewed 9779 times

Re: New Flowcode Wii nunchuck component.

Posted: Tue Sep 01, 2020 6:20 pm
by medelec35
Hi Stefan,
Yes, they are cheap and have uses.
Can you post your Flowchart and I will see if I can spot any thing?
Have you done the usual 1 second flash test?
What happens with I2C in hardware mode?

Re: New Flowcode Wii nunchuck component.

Posted: Wed Sep 02, 2020 10:20 am
by stefan.erni
Hi Martin

Yes the flashtest is ok.

I2C softwaremode:
The two switch are working. If I press one, the first and second value change from 0 to 1. The 3 Axis from Accelerometer are always -512 and the Joystick always 0.

I2C hardwaremode:
There is no clock on the SCL pin.

regards

Stefan
Flip-and_Click_Pic32efh100-display_D_Wii_A.fcfx
(52.38 KiB) Downloaded 302 times
Wii-1.jpg
Wii-1.jpg (151.31 KiB) Viewed 9742 times

Re: New Flowcode Wii nunchuck component.

Posted: Wed Sep 02, 2020 12:25 pm
by medelec35
I can't spot any issues.
stefan.erni wrote:
Tue Sep 01, 2020 6:12 pm
Maybe it's more a PIC32 I2C problem.
Yes I agree.
Do you have an analyser to confirm I2C values?
Unfortunately I don't have your target device, so unable confirm data myself.

Perhaps someone at matrix would be able to check I2C out?

Re: New Flowcode Wii nunchuck component.

Posted: Wed Sep 02, 2020 11:46 pm
by Benj
I'll look into the hardware I2C issue on the MZ devices and see if I can find anything.

Maybe try the Nunchuk component with the encryption property set to yes and see if that gives you any better results?

Re: New Flowcode Wii nunchuck component.

Posted: Thu Sep 03, 2020 9:02 am
by stefan.erni
Hi Ben, Hi Martin

Is it possible to post where to shop working cheap Nunchuck?

There is a problem with hardware I2C and PIC32MZ.
But just in the 100khz and custom mode.
The 400kHz and 1Mhz are working in hardwaremode with the nunchuck.
The software mode is not working for the nunchuck Accelerometer and Joystick but the two switch are working nice.

regards

Stefan
wii-ok.jpg
wii-ok.jpg (160.38 KiB) Viewed 9688 times

Re: New Flowcode Wii nunchuck component.

Posted: Thu Sep 03, 2020 12:19 pm
by medelec35
Hi Stefan,
At least nunchucks are working now which is great news.
stefan.erni wrote:
Thu Sep 03, 2020 9:02 am
Is it possible to post where to shop working cheap Nunchuck?
Here's a link to the ones I bought which work fine for me.

Re: New Flowcode Wii nunchuck component.

Posted: Fri Sep 04, 2020 8:44 am
by stefan.erni
Hi Martin

Thank you for the info.
Yes the nunchuck is working very nice and stable.
regards

Stefan