Author Topic: Basics  (Read 5783 times)

Offline MrMe

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
on: July 11, 2009, 03:03:52 PM
Hi, I'm a newbie here but a programmer in the first place , I have a question , does actually glovepie detect the movement of the wiimote without an IR source ?, I saw some one play need for speed while moving the wii like a driving wheel , and if so what is code ?? , for example for the A button this would be something like wiimote1.A so ?

Thanks in advance



Offline BenjaminBustamove

  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Reply #1 on: July 23, 2009, 10:41:48 PM
I haven't had a whole lot of experience with dealing with the IR/motion sensors, but answering your question about the buttons: you can use simple scripts like so...

Say you want to set the A key on your keyboard to the A button on the wiimote:

Keyboard.A = Wiimote.A

Simple as that, but if you want to make it even more simple...

A = Wiimote.A

Similarly, you could do something like:

Keyboard.UP = Wiimote.UP
Keyboard.DOWN = Wiimote.DOWN
Keyboard.LEFT = Wiimote.LEFT
Keyboard.RIGHT = WIimote.RIGHT

Furthermore, if you want to mess with the LEDs, you need to use simple boolean logic (true/false):

Wiimote.Led1 = true
Wiimote.Led2 = false
Wiimote.Led3 = false
Wiimote.Led4 = true

That script will make it so the first and fourth LEDs will turn on and the second and third will turn off.

One more helpful tip is that if you type in "Keyboard." or "Wiimote." it will give you all of the variables you can use in your script under those subsets.

That's a large part of the basics, if anything was unclear, just say something, someone should get back to you if not me.  For more of the advanced stuff though, I'm not gonna be able to help too much.



Offline MrMe

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Reply #2 on: July 30, 2009, 01:08:43 AM
Thanks dude , thats was so helpful   ;)