Merge remote-tracking branch 'remotes/wiki/master'
This commit is contained in:
50
CompileWiiusejOnLinux.wiki
Normal file
50
CompileWiiusejOnLinux.wiki
Normal file
@@ -0,0 +1,50 @@
|
||||
#summary Compile Wiiusej C part on linux
|
||||
|
||||
Very light summary on how I managed to compile Wiiusej on linux.
|
||||
Contact the mailing list if you face a bug!
|
||||
|
||||
= Introduction =
|
||||
|
||||
What packages you need installed: libc-dev, libbluetooth-dev, xlibmesa-gl-dev, libglu1-mesa-dev, libsdl.
|
||||
|
||||
You need also Java 6 jdk installed, to get the jni interface.
|
||||
|
||||
You need to get `libwiiuse.so` compiled before trying to compile Wiiusej library.
|
||||
|
||||
= Wiiuse library =
|
||||
|
||||
# First, [http://sourceforge.net/project/showfiles.php?group_id=187194 download according version of Wiiuse] (for WiiuseJ v0.12, download Wiiuse v0.12).
|
||||
# Second, compile the Wiiuse lib `libwiiuse.so`
|
||||
|
||||
{{{
|
||||
make
|
||||
make install
|
||||
}}}
|
||||
|
||||
Here, if you did not install the sdl library, you may get a bug. The library is well-compiled anyway.
|
||||
|
||||
= Wiiusej library =
|
||||
Move the `libwiiuse.so` compiled in the src directory of WiiUseJC.
|
||||
|
||||
''Don't forget to replace my jdk folder by yours''
|
||||
|
||||
{{{
|
||||
gcc -shared -fPIC -o libWiiuseJ.so -Wall -L. -lwiiuse -I/home/vincent/jdk1.6.0_05/include -I/home/vincent/jdk1.6.0_05/include/linux wiiusej_WiiUseApi.c
|
||||
}}}
|
||||
|
||||
= Launch on linux =
|
||||
|
||||
Put both libs `libwiiuse.so` and `libWiiuseJ.so` in the folder of `wiiusej.jar`.
|
||||
Put your wiimote in discovery mode by clicking on the buttons 1 and 2 in the mean time.
|
||||
Now launch
|
||||
{{{
|
||||
LD_LIBRARY_PATH=. java -Djava.library.path=. -jar wiiusej.jar
|
||||
wiiuse v0.12 loaded.
|
||||
By: Michael Laforest <thepara[at]gmail{dot}com>
|
||||
http://wiiuse.net http://wiiuse.sf.net
|
||||
[INFO] Found 1 bluetooth device(s).
|
||||
[INFO] Found wiimote (00:1B:7A:35:55:F6) [id 1].
|
||||
[INFO] Connected to wiimote [id 1].
|
||||
...
|
||||
window is opening
|
||||
}}}
|
||||
102
Documentation.wiki
Normal file
102
Documentation.wiki
Normal file
@@ -0,0 +1,102 @@
|
||||
#labels Featured,Phase-Deploy
|
||||
#User documentation.
|
||||
|
||||
|
||||
|
||||
=Detailed documentation=
|
||||
|
||||
|
||||
WiiuseJ is very easy to use. You have very few things to do get info from your wiimote(s).
|
||||
|
||||
|
||||
First, make a project. Import wiiusej.jar and put the 2 dlls files at the root of your project (or the two .so files if you are under linux).
|
||||
|
||||
|
||||
|
||||
Then make a class (for example MyClass) implementing WiimoteListener with it.
|
||||
For example, in the following example, each method implemented receives the differents event Types : ButtonsEvent, IREvent, MotionSensingEvent, ExpansionEvent, StatusEvent, DisconnectionEvent, NunchukInsertedEvent and NunchukRemovedEvent(check Javadoc to see what infos you get from each event type). In this case in each method we only display the event received.
|
||||
|
||||
|
||||
{{{
|
||||
public void onButtonsEvent(WiimoteButtonsEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
if (arg0.isButtonAPressed()){
|
||||
WiiUseApiManager.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
public void onIrEvent(IREvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onMotionSensingEvent(MotionSensingEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onExpansionEvent(ExpansionEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onStatusEvent(StatusEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onDisconnectionEvent(DisconnectionEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onNunchukInsertedEvent(NunchukInsertedEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
public void onNunchukRemovedEvent(NunchukRemovedEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
}
|
||||
|
||||
|
||||
}}}
|
||||
|
||||
|
||||
Next you can make a main. Like this :
|
||||
|
||||
|
||||
{{{
|
||||
public static void main(String[] args) {
|
||||
Wiimote[] wiimotes = WiiUseApiManager.getWiimotes(1, true);
|
||||
Wiimote wiimote = wiimotes[0];
|
||||
wiimote.activateIRTRacking();
|
||||
wiimote.activateMotionSensing();
|
||||
wiimote.addWiiMoteEventListeners(new MyClass());
|
||||
}
|
||||
}}}
|
||||
|
||||
|
||||
Here you ask to try to connect to 1 wiimote (and make it rumble, the first time you call this method). You can ask for more if more are connected. It returns you an array with the connected wiimote. Then you can manipulate each wiimote and activate IR tracking, motion tracking and set up other parameters if you want... Check javadoc for more details.
|
||||
|
||||
|
||||
{{{
|
||||
wiimote.addWiiMoteEventListeners(new MyClass());
|
||||
}}}
|
||||
|
||||
|
||||
This line permits you to set an instance of MyClass as a listener of the wiimote.
|
||||
When events from this wiimote occur they are sent to every WiimoteListener. Here there is only one, an instance of MyClass.
|
||||
|
||||
|
||||
If you launch this program it will display the content of every events.
|
||||
|
||||
|
||||
|
||||
An example of use of ButtonsEvent can be this one. If we want to end our program you can shutdown the WiiuseManager(Object that manages all wiimotes) when the button A is pressed.
|
||||
Example:
|
||||
|
||||
{{{
|
||||
public void onButtonsEvent(ButtonsEvent arg0) {
|
||||
System.out.println(arg0);
|
||||
if (arg0.isButtonAPressed()){
|
||||
WiiUseApiManager.getInstance().shutdown();
|
||||
}
|
||||
}
|
||||
}}}
|
||||
|
||||
This sample app can be downloaded in the download section. It is a Netbeans project.
|
||||
35
FAQ.wiki
Normal file
35
FAQ.wiki
Normal file
@@ -0,0 +1,35 @@
|
||||
#labels Featured,Phase-Support
|
||||
#Frequently Asked Questions
|
||||
|
||||
= Frequently Asked Questions =
|
||||
|
||||
*Q :* Can WiiuseJ send audio to the wiimote ?
|
||||
|
||||
A : Wiiuse doesn't support it so WiiuseJ can't support either.
|
||||
|
||||
|
||||
*Q :* Why do i got this error ?
|
||||
{{{
|
||||
|
||||
Exception in thread "Thread-0" java.lang.NoSuchMethodError: java.util.Arrays.copyOfRange([Ljava/lang/Object;II)[Ljava/lang/Object;
|
||||
|
||||
at wiiusej.wiiuseapievents.EventsGatherer.getEvents(EventsGatherer.java:227)
|
||||
|
||||
at wiiusej.WiiUseApiManager.run(WiiUseApiManager.java:415)
|
||||
|
||||
[INFO] Connected to wiimote [id 1].
|
||||
|
||||
}}}
|
||||
|
||||
A : So far you need java 1.6 to use WiiuseJ. Here a method from java 1.6 is missing in the java you have. I'll fix it in another release.
|
||||
|
||||
|
||||
*Q :* How can i reconnect the wiimotes and find new wiimotes.
|
||||
|
||||
A : Shutdown WiiuseJ: WiiUseApiManager.shutdown(); and get wiimotes again : WiiUseApiManager.getWiimotes(2, true);
|
||||
|
||||
|
||||
*Q :* I have this error: Error: [ERROR] Unable to
|
||||
determine bluetooth stack type. What can i do ?
|
||||
|
||||
A : You can try to force the type of bluetooth stack you got. This is only for windows. For this get the wiimotes this way : WiiUseApiManager.getWiimotes(2, true, WiiUseApiManager.WIIUSE_STACK_MS); if you got a windows bluetooth stack or widcomm. Use WiiUseApiManager.WIIUSE_STACK_BLUESOLEIL if you got bluesoleil.
|
||||
21
QuickUserGuide.wiki
Normal file
21
QuickUserGuide.wiki
Normal file
@@ -0,0 +1,21 @@
|
||||
#labels Featured,Phase-Deploy,wiiusej
|
||||
#Quick user guide.
|
||||
|
||||
=Quick doc=
|
||||
|
||||
{{{
|
||||
|
||||
1) import wiiusej.jar in your java project.
|
||||
|
||||
2) put the 2 dlls files libWiiUseJ.dll and wiiuse.dll at the root of your project (or the two .so files if you are under linux).
|
||||
Connect your wiimote to your bluetooth stack.
|
||||
|
||||
3) In your code : Wiimote[] wiimotes = WiiUseApiManager.getWiimotes(X, true);//x is the number of wiimotes to connect. True : make it rumble the first time you get the wiimotes.
|
||||
|
||||
4) Make a class (MyListener) implementing the WiimoteListener interface.
|
||||
|
||||
5) wiimote[0].addWiiMoteEventListeners(new MyListener());//register my class as a listener of the first wiimote.
|
||||
|
||||
===> MyListener will receive events from the wiimotes is registered on.
|
||||
|
||||
}}}
|
||||
19
TestWiiuseJ.wiki
Normal file
19
TestWiiuseJ.wiki
Normal file
@@ -0,0 +1,19 @@
|
||||
#labels Featured,Phase-Deploy
|
||||
#How to test wiiuseJ quickly.
|
||||
|
||||
=Step by step test=
|
||||
0) Make sure you hava Java 1.6 installed on you computer.
|
||||
|
||||
1) Download WiiUseJ 0.12.zip
|
||||
|
||||
|
||||
2) Unzip all the files in the same folder (ex: c:\temp)
|
||||
|
||||
|
||||
3) Connect the wiimote to your bluetooth stack if you are under windows.
|
||||
Activate connection mode of wiimote if you are under linux (push buttons 1 and 2 in the meantime).
|
||||
|
||||
|
||||
4) Double Click wiiusej.jar ====> the WiiuseJ Test GUI should appear and your wiimote vibrate.
|
||||
|
||||
If double click doesn't work : click on Start -> execute -> cmd (enter) -> cd c:\temp (enter) -> java -jar wiiusej.jar (enter).
|
||||
Reference in New Issue
Block a user