Using wiimote on your pc.

General chat area for anything whatsoever

Moderator: Core Staff

Post Reply
User avatar
Infinite
PC Team
PC Team
Posts: 2385
Joined: April 11th, 2008, 4:39 pm
Location: Roswell, Georgia

Using wiimote on your pc.

Post by Infinite » January 21st, 2009, 1:49 am

Well, recently i had regretted (and i knew this would happen) getting Guitar Hero 3 for the wii (not gh:wt tho, that game pwnz on the wii), seeing as how you can have custom songs on the wii, including songs such as, Scars of Yesterday by Dragonforce and A7x songs.

Code: Select all

http://www.youtube.com/watch?v=JCxoPfZvcms
http://www.youtube.com/watch?v=6FQ6uDQHlBg
I was talking about it with one of my friends and he said "well, you can use a bluetooth usb adapter and hook up your wiimote to the PC if you want to that badly". so i looked it up and found these:

Code: Select all

http://www.wiiprojects.org/bluetooth.html
http://www.mundayweb.com/progs/gh3-wii.php
http://www.youtube.com/watch?v=9IqGtdLyKYA
I found it very interesting and you can actually do almost anything with the wii mote that you could do normally with a mouse or keyboard (if you can program it xD). The program used to "code" the commands for the wiimote is called GlovePIE (http://carl.kenner.googlepages.com/glovepie). Here's an example of the script which i am using for gh3 with my guitar.

Code: Select all

/*
 * Based on version from http://wizardswhinings.blogspot.com/2008/03/how-to-use-wii-guitar-hero-iii-guitar.html
 *
 * Modified by Neil Munday, July 2008
 */
          
Key.Ctrl = False
Key.LeftShift = False
Key.LeftAlt = False
Key.RightAlt = False

debug = 'whammy=' + wiimote.Guitar.WhammyBar + ', pitch=' + RemoveUnits(Wiimote.Pitch)

//change these to your liking (use debug info)
var.whammythreshold = 0.55
var.starpowerangle = 50

Keyboard.LeftShift = Wiimote.Guitar.Fret1
Keyboard.Z = Wiimote.Guitar.Fret2
Keyboard.X = Wiimote.Guitar.Fret3
Keyboard.C = Wiimote.Guitar.Fret4
Keyboard.V = Wiimote.Guitar.Fret5
//make the 4 wiimote leds light up with the first 4 frets
Wiimote.Led1 = Wiimote.Guitar.Fret1
Wiimote.Led2 = Wiimote.Guitar.Fret2
Wiimote.Led3 = Wiimote.Guitar.Fret3
Wiimote.Led4 = Wiimote.Guitar.Fret4
//other mappings
Keyboard.Space = Wiimote.Guitar.Minus
Keyboard.RightShift = Wiimote.Guitar.StrumUp
Keyboard.Slash = Wiimote.Guitar.StrumDown
Keyboard.Backspace = Wiimote.Guitar.Plus

//make whammy when whammy is pushed
If Wiimote.Guitar.WhammyBar > var.whammythreshold
   Mouse.x = Wiimote.Guitar.WhammyBar
EndIf
//push star power button when guitar is tilted
/*If RemoveUnits(Wiimote.Pitch) > var.starpowerangle
 * Key.Space = True
 * Wiimote.Rumble = False
 * Wait 1000 ms
 * Key.Space = False
 * Wiimote.Rumble = False
 *EndIf
 */
(I disabled the last bit because i hate activating Starpower by accident by tilting my guitar (i use select/- to activate it) and i found it neat that you can assign the LED lights on the wii to certain buttons in this bit

Code: Select all

Wiimote.Led1 = Wiimote.Guitar.Fret1
Wiimote.Led2 = Wiimote.Guitar.Fret2
Wiimote.Led3 = Wiimote.Guitar.Fret3
Wiimote.Led4 = Wiimote.Guitar.Fret4
)

Atm i can't test this out because i don't have a bluetooth usb adapter, but i ordered one from Amazon about an hour ago and it should be here in 2-3 days (because amazon is a beast at shipping), so i'll update this thread when i get it and test it out =P.
Last edited by Infinite on January 21st, 2009, 1:53 am, edited 1 time in total.
Image
"The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together."
"A still more glorious dawn awaits- not a sun rise, but a galaxy rise. A morning filled with four hundred billion suns: the rising of The Milky Way." - Carl Sagan

[15:19] _MattyTÒ£eFarmer_: infinate
[15:19] _MattyTÒ£eFarmer_: u r smarter than me

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Using wiimote on your pc.

Post by Nightmare » January 21st, 2009, 1:52 am

There was a post about this a while back.

Johnny Lee is another guy on Youtube who has been doing some pretty interesting things with the wii motes.
http://www.youtube.com/profile?user=jcl5m&view=videos
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Infinite
PC Team
PC Team
Posts: 2385
Joined: April 11th, 2008, 4:39 pm
Location: Roswell, Georgia

Re: Using wiimote on your pc.

Post by Infinite » January 21st, 2009, 1:54 am

Nightmare wrote:There was a post about this a while back.

Johnny Lee is another guy on Youtube who has been doing some pretty interesting things with the wii motes.
http://www.youtube.com/profile?user=jcl5m&view=videos
Must've missed it/never seen it in the year that i've been here :<

EDIT: just saw that head tracking video (http://www.youtube.com/watch?v=Jd3-eiid ... annel_page) and wow, that's just out of this world x.x.
Image
"The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together."
"A still more glorious dawn awaits- not a sun rise, but a galaxy rise. A morning filled with four hundred billion suns: the rising of The Milky Way." - Carl Sagan

[15:19] _MattyTÒ£eFarmer_: infinate
[15:19] _MattyTÒ£eFarmer_: u r smarter than me

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Re: Using wiimote on your pc.

Post by [SoE]_Zaitsev » January 21st, 2009, 12:17 pm

Yeh that guy is awesome. Was impressed when I saw a few of his movies.
matt101harris wrote:big cock was the first thing that came to my head lol

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Re: Using wiimote on your pc.

Post by JDogg » January 21st, 2009, 12:50 pm

Head tracking is pretty cool, thanks for sharing your code, I'm sure it will help someone.
Image
Image

User avatar
Infinite
PC Team
PC Team
Posts: 2385
Joined: April 11th, 2008, 4:39 pm
Location: Roswell, Georgia

Re: Using wiimote on your pc.

Post by Infinite » January 21st, 2009, 2:31 pm

Well, i didn't really make it, i did modify a few things in it tho =x.
Image
"The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together."
"A still more glorious dawn awaits- not a sun rise, but a galaxy rise. A morning filled with four hundred billion suns: the rising of The Milky Way." - Carl Sagan

[15:19] _MattyTÒ£eFarmer_: infinate
[15:19] _MattyTÒ£eFarmer_: u r smarter than me

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Re: Using wiimote on your pc.

Post by JDogg » January 22nd, 2009, 1:34 am

Infinite wrote:Well, i didn't really make it, i did modify a few things in it tho =x.
Ohh ok then. Is there a site with other scripts like these?.
Image
Image

User avatar
Infinite
PC Team
PC Team
Posts: 2385
Joined: April 11th, 2008, 4:39 pm
Location: Roswell, Georgia

Re: Using wiimote on your pc.

Post by Infinite » January 24th, 2009, 11:55 pm

There are probably other sites with scripts like this one, but it's probably easier to make your own.

I finally got my bluetooth usb adapter and I'm VERY impressed. I only had one problem hooking it up, and it was very minor (i had the wrong version of GlovePie.) And it took me about 5 minutes to hook up, but i'm VERY impressed. the programs worked perfectly and i got it to work like a charm. there is barely any lag from the wiimote to the adapter, and i actually played some gh3 songs on my PC on expert and it worked great. I wonder what else i can do with this, i've already saved atleast $30 by buying this usb adapter xD. (it cost me $6, but i got it through shipping so it was really about $3).\

EDIT: just wrote a cool script for my wiimote xD

Code: Select all

Wiimote.Led1 = True
Wait 50 ms
Wiimote.Led1 = False
Wiimote.Led2 = True
Wait 50 ms
Wiimote.Led2 = False
Wiimote.Led3 = True
Wait 50 ms
Wiimote.Led3 = False
Wiimote.Led4 = True
Wait 50 ms
Wiimote.Led4 = False
As you can probably tell, it baically turns the lights on an off, gonna change it to 1000 ms probably, since it'll waste my batteries tho =x.

2nd EDIT: starting to make a scrip which lets you use use the wiimote as a mouse basically, a wireless one which doesn't need a pad to rest on xD. It's basically a bunch of if statements, but it works great. The up, down, left, and right arrows are used to move the mouse, A is used for mouse1 or left click, B is used for right click or Mouse2, and + is used to hold down mouse1

Code: Select all

if Wiimote.up = 1
 Mouse.y -= 0.005
EndIf
If Wiimote.down = 1
Mouse.y += 0.005
EndIf
If Wiimote.right = 1
Mouse.x += 0.005
EndIf
If Wiimote.left = 1
Mouse.x -= 0.005
EndIf
If Wiimote.a = 1
Mouse.LeftButton = 1
Wait 50 ms
Mouse.LeftButton = 0
EndIf
If Wiimote.b = 1
Mouse.RightButton = 1
Mouse.RightButton = 0
EndIf
If Wiimote.Plus = 1
Mouse.LeftButton = 1
EndIf
3rd EDIT: (lols) made another script which turns my wiimote into a remote control for my winamp player :> (i have a keyboard with the keys at the top of it which can go forward, backward, pause/play, and stop and those work with winamp so i used some of them)

Code: Select all

var.wait = 200
If Wiimote.up = 1
Keyboard.playpause = 1
Keyboard.playpause = 0
Wait 300 ms
EndIf
If Wiimote.right = 1
Keyboard.nextTrack = 1
Keyboard.nextTrack = 0
Wait 300 ms
Endif
If Wiimote.left = 1
Keyboard.prevTrack = 1
Keyboard.prevTrack = 0
Wait 300 ms
Endif
If Wiimote.down = 1
Keyboard.stop = 1
Keyboard.stop = 0
Wait 300 ms
Endif
If Wiimote.plus = 1
Keyboard.leftcontrol = 1
Keyboard.leftAlt = 1
Keyboard.Up = 1
Keyboard.leftcontrol = 0
Keyboard.leftAlt = 0
Keyboard.Up = 0
Endif
If Wiimote.minus = 1
Keyboard.leftcontrol = 1
Keyboard.leftAlt = 1
Keyboard.Down = 1
Keyboard.leftcontrol = 0
Keyboard.leftAlt = 0
Keyboard.Down = 0
Endif
If Wiimote.home = 1
Keyboard.mute = 1
Keyboard.mute = 0
wait 300ms
Endif
If Wiimote.one = 1
Keyboard.Volumeup = 1
Keyboard.Volumeup = 0
wait 200ms
EndIf
If Wiimote.two = 1
Keyboard.Volumedown = 1
Keyboard.Volumedown = 0
wait 200ms
EndIf
If Wiimote.A = 1
Wiimote.Led1 = True
Wait var.wait ms
Wiimote.Led2 = True
Wait var.wait ms
Wiimote.Led3 = True
Wait var.wait ms
Wiimote.Led4 = True
Endif
If Wiimote.B = 1
Wiimote.Led4 = False
Wait var.wait ms
Wiimote.Led3 = False
Wait var.wait ms
Wiimote.Led2 = False
Wait var.wait ms
Wiimote.Led1 = False
Endif
If Wiimote.Pitch > 60
Wiimote.rumble = True
Else
Wiimote.rumble = False
Endif
Image
"The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together."
"A still more glorious dawn awaits- not a sun rise, but a galaxy rise. A morning filled with four hundred billion suns: the rising of The Milky Way." - Carl Sagan

[15:19] _MattyTÒ£eFarmer_: infinate
[15:19] _MattyTÒ£eFarmer_: u r smarter than me

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest