Posted: 07:51pm 26 Apr 2024 Copy link to clipboard
homa Senior Member
Hello @peter and all the other cmm2 experts,
I'm new to the cmm2. I am using Peter's V2 G1.5 board. My second hand wii classic controllers have finally arrived and I have tested them on the cmm2. I wrote the following code:
controller classic open 3,dada
do 'cls circle classic(Lx)+10, (classic(Ly)*-1+256)+10, 10,,, 0, RGB(255,255,255) circle classic(Rx)+10, (classic(Ry)*-1+256)+10, 10,,, 0, RGB(127,196,127) loop
END
sub dada print classic(b) print classic(Lx), print classic(Ly) print classic(Rx), print classic(Ry) print classic(L), print classic(R) print hex$(classic(T)) end sub
Now the output of the print command shows an extra 0, which I don't understand! The HEX value also seems to be different from the one given in the manual for this type of controller (A4200101 vs 4200101).
Then I noticed another flaw in the hardware design. You need a tool to get the plugs out of the sockets ;-)
And I can only get the first controller (3) to work.
If I plug in a 2 (controller classic open 2,dada), I get this message: Error in line 1: Classic not connected
And with a 1 ((controller classic open 1,dada)) I get this error message: Error in line 5: Not open
Is this because of the Beta FW V5.07.02b11?
Best regards Matthias
Posted: 08:38pm 26 Apr 2024 Copy link to clipboard
JohnS Guru
The 0 is because you try to PRINT the value of a variable called print!
E.g. print classic(Lx), print classic(Ly)
I think you need to remove the 2nd print or change the , to :
John
Posted: 08:47pm 26 Apr 2024 Copy link to clipboard
homa Senior Member
Head slap Thanks John, I had tomatoes on my eyes.
But the other questions still remain ...
Posted: 10:13pm 26 Apr 2024 Copy link to clipboard
thwill Guru
Hi @homa,
My specialist subject .
It's a typo in the manual which I've brought up before. The correct code is &hA4200101 (and &hA4200000 for a Nunchuck).
For the two port design the left-hand port is connected to I2C channel 3 and the right-hand one to I2C channel 1. Only the CMM2 Deluxe has a port connected to channel 2.
I believe your mistake is not providing the second parameter in all the calls to the CLASSIC(funct [, channel]) function, if you don't provide a second parameter then it assumes channel 3.
Best wishes,
Tom Edited 2024-04-27 08:25 by thwill
Posted: 09:49am 27 Apr 2024 Copy link to clipboard
homa Senior Member
It's been a tough week, and yesterday was definitely too late.