| View previous topic :: View next topic |
| Author |
Message |
guiguito
Joined: 16 Dec 2007 Posts: 14
Digg It |
Posted: Thu Mar 13, 2008 9:08 am Post subject: |
|
|
ok please develop in eclipse or netbeans its is much easier.
at the root of your program put the two dlls, provided with wiiusej and import wiiusej.jar in your project.
Create a class called my class implementing WiimoteListener. The beginning of your class then must be :
public class MyClass implements WiimoteListener {
...
implementing WiimoteListener you will have to fill few methods, one is onIrEvent . Put your code that wants to play with results from infrared cam in this method.
Then make the same main as you did and correct your line :
wiimotes.addWiimoteListener(new MyClass());
normally it should work.
if you can't make it i'll provide a full example.
There is still an example in the source code of wiiusej in : src/wiiusej/tests/Tests.java you can try to understand this one ... |
|
| Back to top |
|
 |
SilentShaddow
Joined: 10 Feb 2008 Posts: 33
Digg It |
Posted: Thu Mar 13, 2008 10:00 am Post subject: |
|
|
ok, so I put that in my notepad file:
| Code: | import wiiuse.*;
public class DMXControl
{
public static void main(String args[]) throws exception
{
System.out.println("1");
Wiimote[] wiimotes = WiiUseApiManager.getWiimotes(1);
wiimotes.addWiimoteListener(new MyClass);
System.out.println("3");
};
} |
and went with that, which doesnt compile:
| Code: | C:\Users\Toby\Downloads\wiiuse-0.9-win>javac DMXcode.java
DMXcode.java:8: '(' or '[' expected
wiimotes.addWiimoteListener(new MyClass);
^
1 error |
The website mentions a wiimotelistener interface? what is that and how do I use it? also it appears that outputing to the lights involves creating some form of dll file that the driver uses... .dlls seem to be where its at these days.
go to go to a lecture, be back in 2 hours.
Silent |
|
| Back to top |
|
 |
guiguito
Joined: 16 Dec 2007 Posts: 14
Digg It |
Posted: Thu Mar 13, 2008 11:53 am Post subject: |
|
|
| SilentShaddow wrote: | ok, so I put that in my notepad file:
| Code: | import wiiuse.*;
public class DMXControl
{
public static void main(String args[]) throws exception
{
System.out.println("1");
Wiimote[] wiimotes = WiiUseApiManager.getWiimotes(1);
wiimotes.addWiimoteListener(new MyClass);
System.out.println("3");
};
} |
and went with that, which doesnt compile:
| Code: | C:\Users\Toby\Downloads\wiiuse-0.9-win>javac DMXcode.java
DMXcode.java:8: '(' or '[' expected
wiimotes.addWiimoteListener(new MyClass);
^
1 error |
The website mentions a wiimotelistener interface? what is that and how do I use it? also it appears that outputing to the lights involves creating some form of dll file that the driver uses... .dlls seem to be where its at these days.
go to go to a lecture, be back in 2 hours.
Silent |
first it is wiiusej.* in you import.
To deal with imports use netbeans or eclipse.
and to make an instance of MyClass it is written this way: new MyClass();
then show me the code of yours MyClass.
and read the book: thinking in java |
|
| Back to top |
|
 |
SilentShaddow
Joined: 10 Feb 2008 Posts: 33
Digg It |
Posted: Tue Mar 18, 2008 1:38 pm Post subject: |
|
|
Ok well, ive got netbeans now, and im stuggling importing stuff, I dont know how to. Ive tried putting the wiiusej.jar thing in places like the in the source
packages and the libaries but to no avail,
Ive also tried to load your thingy, I didnt do to well at that either. A sample thingy that I could adapt I think would be alot easier.
Silent |
|
| Back to top |
|
 |
guiguito
Joined: 16 Dec 2007 Posts: 14
Digg It |
Posted: Tue Mar 18, 2008 5:08 pm Post subject: |
|
|
on the website there is a sample app, for netbeans. Open it in netbeans and on the name on the project go to properties and correct the imported jar for your environment and it should work.
tell me if you are still struggling |
|
| Back to top |
|
 |
SilentShaddow
Joined: 10 Feb 2008 Posts: 33
Digg It |
Posted: Tue Mar 18, 2008 8:31 pm Post subject: |
|
|
| ok, well it looks like the real deal, still having problems with the imports though. I added the folder with wiiusej.jar in it to the 'libaries' part of the SampleAppWiiuseJ project |
|
| Back to top |
|
 |
guiguito
Joined: 16 Dec 2007 Posts: 14
Digg It |
Posted: Wed Mar 19, 2008 8:15 am Post subject: |
|
|
| on the file with imports troubles. Right click and click fix imports ... |
|
| Back to top |
|
 |
|