Wiimote for ps2dev

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Wiimote for ps2dev

Post by ps2devman »

I will try to create a windows program that redirects wiimote input data (detected with the existing Windows programs out there) towards ethernet (with raw ip packets).
With the AFL independant packet driver source, I should be able to publish a small game (Pong probably), compiled with ps2dev, that can be controlled with the wiimote.
The windows program will be open source, so everyone will be able to use it and detect the data from within the received ip packets, on any machine able to detect raw packets.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Here it is:

http://home.tele2.fr/~fr-51785/inp2eth.zip

Now, all I have to do is Pong.elf that detects the incoming packets.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

I've realized something...
Glovepie can be used to convert midi notes into windows key events!

Any guitar hero out there?
I only have a midi piano keyboard, but I guess someone whith a real midi guitar could make a remake with ps2dev, glovepie & inp2eth!
What is the range of notes a guitar can throw out?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ps2devman wrote:What is the range of notes a guitar can throw out?
See wikipedia: http://en.wikipedia.org/wiki/Guitar_tuning
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Thx for the link.

I confirm that the incredibly cheap & small BT-2210Tp supplied with WIDCOMM software works very well with the wiimote. That makes the bluetooth usb "key"+1 wiimote at 60 bucks (around), delivered fast.
Nunchuk is additional 20 bucks delivered 1 month later...

Tutorial to have WIDCOMM recognize and connect with the wiimote :
http://wiibrew.org/index.php?title=Wiimote_Tutorial

GlovePIE's author web site :
http://carl.kenner.googlepages.com/glovepie

GlovePIE is free and will work instantly, just load a wiimote script (plenty are supplied) and hit "Run".

For example, load CounterStrike.PIE, run it. Launch notepad, and use D-PAD to write letters.

I've seen a script for 4 wiimotes...

I've updated inp2eth :

- added mouse.x and mouse.y data (so now, 16 bytes for 128 keys map + 2 bytes for mouse position)
- added inp2eth.PIE, a recommended script for GlovePie (will keep mouse in middle of inp2eth window)

My test shows that wiimote is not enough good or precise to detect "translations" (other than brutal punches)
but is quite good in detecting "rotations". So you better keep your arm straight and unfolded and let the wiimote do nice rotations instead of pointing the wiimote always at the same direction.

And when you plan to make a game, try to find a way to ask player to "rotate" wiimote or just "punch".

Against the noise that makes values eratic, some numeric filtering can fix that. But better do it on console side. So don't worry if coordinates sent by inp2eth are very eratic.

The only problem I found is the incredible speed of the battery discharge... 20% after a few hours...
The script will show you the battery level.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Added a GlovePIE script for two simultaneous wiimotes
(rotation around X axis for both wiimotes converted into mouse.x & .y
rotation around Z axis for both wiimotes converted into up,down,left,right)
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

The battery discharge speed is really a problem, especially for a developper trying to write some driver for hours...

If you know what you are doing and supply a voltage in the 2.5v-3v range with a regulator circuit using LM317 for example (http://www.fairchildsemi.com/ds/LM/LM317.pdf) the wiimote will work fine without battery (actually I keep them in there but I put a paper to cut circuit. the batteries are a good way to keep unsoldered external wires connected inside. trap can still be shut with the thin wires going out)

I've even tried the "Mini Solar Panel 3V 100mA" (it gave me 4V with a nice sun) as power source for the LM317 regulator (caution, don't connect it directly to the wiimote or you will destroy it!). It worked fine. Solar panel is so small that it can fit on a player's wrist... That might be an idea...
But I guess a zener diode is necessary to build up a voltage reference that doesn't depend on weather...

I should have some infrared diode somewhere, I will see if I can have wiimote infra red camera see it... This little thing is really fun to play with.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

I've discovered why wiinremote makes the wiimote shutdowns when it's powered with low voltage... It requests IR sensor data immediately.
With GlovePIE it works, until I ask for wiimote.dot1vis (IR sensor data).
So I guess the IR sensor data pumps too much current for the low voltage.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Oh my... it's really fun...
Solar panel still good (3.2v) powering an InfraRed (colorless) LED I kept from an old broken remote, through a 68ohms 2W resistor...

The GlovePIE script wiimote.dot1vis variable turns from false to true when I pass the wiimote IR camera in front of the LED...
(wiinremote seems expecting too much and don't see a thing)

fun and cheap!
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

I've updated a last time inp2eth
http://home.tele2.fr/~fr-51785/inp2eth.zip

You can now try it with the gsKit starter kit Pong
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

This is very nice, thank you for keeping us up to date! For me particularly I was interested to read about what kind of data the Wii-mote can produce accurately and what it cannot, like your comment on circular motion versus forward motion.

Now I wish you would do something similar with the Sixaxis. :P But I better google if there are people who already did this.
fr0st m0nkey
Posts: 10
Joined: Sun Jan 30, 2005 4:52 pm
Contact:

Post by fr0st m0nkey »

Is this working?
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Yes. Starter kit Pong reuses it successfully. See starter kit Initial Fantasy post for links to the various starter kits.

It's Academic Free License, so feel free to rip any part you need for adding wiimote support to your own games.

Actually, mse2eth is even more interesting, because the feature I like the most in wiimote is the light gun feature (precise pointing thanks to infrared frontal camera and 2 infra red sources put above or under TV)
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

http://home.tele2.fr/~fr-51785/mse2eth.zip is an alternate version well adapted to the "light gun" feature.

I've just purchased two "Light Gun Adaptors" (you can see photographs if look for this name on ebay).

Quite comfortable and quite good aim if you keep gun at 3 meters from standard wii IR bar. However much stuff is to be done in menus through A button (top button) and the gun trigger is connected to B of course.

They come from hongkong without any documentation.

I laugh because obviously, package has been opened/examined/sealed (there are some red seals on it...). Obviously hard plastic guns toys don't go thru customs without being noticed. Normal.

There is a little thing to know. There is some wires in the hilt to allow you to connect a nunchuk (or any other device) at the bottom of the hilt.

If you connect the wiimote first, then the nunchuk, link doesn't work.
If you connect the nunchuk, then the wiimote, then link works.
There is a little PCB inside. Dunno what's going on in this link. Whatever.
Hard to guess without documentation...

My final judgement is... Great product!
I smell some Time Crisis remake coming!
(And lots of fun with resident evil 4...)
Nucklez
Posts: 1
Joined: Fri Mar 21, 2008 3:06 am

Post by Nucklez »

This looks like a really promising project guys! I'm curious if this allow someone to use the Wii Guitar Hero guitars for the PS2 guitar heros? Guitar Hero III for the Wii is the first one I've played and now I'm addicted! I have two Wii Guitars, and I'm thinking of purchasing the Guitar Heros for the PS2. I've thought around many ways to get those Wii guitars to work with my PS2. I've looked around for some bluetooth drivers for PS2, and possibly modifying that Bluetooth headset mod that I've seen on other websites. I guess I need to study the hardware part of a bluetooth receiver and see what I can come up with. Be nice if we could come up with a usb adapter that could pair to the Wiimote without any PC intervention. Or, possibly a one time pair with a PC to program a bluetooth device. Hmmm
Post Reply