Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] WiiMote for PC

Author
Message
Jukuma
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 6th Sep 2009 00:06 Edited at: 6th Sep 2009 04:49
This little source give you a control over the WiiMode
low Functions. You must the WiiMote connect to your
PC Bluetooth Stack with your system drivers or with the
software for the Bluetooth USB Stick.

To run this source you must have ...

Bluetooth Class 2 ... connected with your WiiMote
Internet connect ... to load the external wii.dll

Jukuma
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 6th Sep 2009 00:09 Edited at: 11th Sep 2009 03:23
Jukuma
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 21st Sep 2009 20:15 Edited at: 21st Sep 2009 22:52
Here is a pure Source for DBP without a DLL or plugin.

Example WiiMote Motion ...


Include Functions for DBP ...


hWii = WiiConnect()
Handle for WiiMote.

WiiDisconnect(hWii)
Free all WiiMote stuff.

WiiInit(hWii)
Init befor main loop.

bat = WiiBatterie(hWii)
Batterie status in %.

WiiLED(hWii, n)
4 Bits for WiiMote LED's.
(Ex. WiiLED(hWii, %0001) turn the left LED on)

WiiRumble(hWii, n)
On = 1 or Off = 0.

X = WiiMotionX() / Y = WiiMotionY() / Z = WiiMotionz()
Value from X_(10bit): -512 to 512
Value from Y__(9bit): -256 to 256
Value from Z__(9bit): -256 to 256

B = WiiButton?()
All buttons give a TRUE(1) if pressed.

P = WiiPad?()
All Pads give a TRUE(1) if pressed.

WiiRead(hWii)
Fast read data report.

WiiReadEx(hWii, ID)
Read report and wait of request.

WiiWrite(hWii, d$)
Do nothing here, or you know wath to do.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 22nd Sep 2009 13:14
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Sep 2009 16:48
A pure source method of using the WiiMote, very impressive!
Jukuma
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 22nd Sep 2009 20:57
@N3wton:
This version do not need .net Framework and it is not
a wrapper.

I work simultaneously on a plugin for DBP.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 25th Sep 2009 01:51
nice one , if you don`t mind can i use use your code as a base for a gdk plugin ,i have already wrapped dales wiimote dll for the opensource project for gdk , but it means having to have two dlls with your exe .

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Jukuma
20
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 25th Sep 2009 19:26
Thank's. Use it as you like, but remeber the "ReadFile" and
"WriteFile" of Kernel32 can use a OVERLAPPED structure. This
can be useful. The "WriteFile" method is not the best way,
use it carefully or you get a Blue Screen. Not all can writes
on this way at your WiiMote.

Information abaut WiiMote Reports:
http://wiibrew.org/wiki/Wiimote
http://wiki.wiimoteproject.com/
Bekk Bee
14
Years of Service
User Offline
Joined: 5th Oct 2009
Location:
Posted: 6th Oct 2009 00:07
Haii I have a great idea for a wii game.
Its called be your mii."
What you do on it you live at the island.
Beacause the island is so cool. And you wanna explore it so your own thing. So really you walk around the town and blah and if you wanna play one of the games you would go into the shop or near were it is. And also you can buy clothes get a job stay at a motel. Hire a boat or a plane to get to the other little island. And so much more. I think it will be a great game.
Thanxx .
Oh P.S
I new at this thing so i wasnt sure if you did it this way
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 16th Oct 2009 01:19
Quote: "I new at this thing so i wasnt sure if you did it this way"

This is a developer forum, if you want to make that game, go ahead and we'll help where we can. Don't expect people to make a game for you based on a loose idea though.

TGC Forum - converting error messages into sarcasm since 2002.

Login to post a reply

Server time is: 2024-04-25 08:18:05
Your offset time is: 2024-04-25 08:18:05