WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A newbie's question~Thanks!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ
View previous topic :: View next topic  
Author Message
manorboy



Joined: 21 Jul 2008
Posts: 3

Digg It
PostPosted: Mon Jul 21, 2008 8:54 am    Post subject: A newbie's question~Thanks!

Hello everybody:

I'm a newbie.I want to connect the wiiremote to my PC and get the

value of the acceleration and the Button.If I use the WiimoteJ's API.

How to write a simple code? It's can printout value when I press and

move. (It's shoudn't use the IR sensor)

Can anyone help me?

Thanks a lot!!
Back to top
View user's profile Send private message
yundi



Joined: 15 Mar 2008
Posts: 29

Digg It
PostPosted: Mon Jul 21, 2008 9:54 am    Post subject:

Hi nanorboy, you shoul download first the latest WiiRemoteJ version here http://www.world-of-cha0s.hostrocket.com/WiiRemoteJ/WiiRemoteJ%20v1.5.zip.gz and once you've opened it, you can see the WRLImpl.java, it's an example code of the WiiRemoteJ's possibilities, if you are specially interested in connecting take a look at line 121 (copy & paste from WRLImpl.java):
Code:

            //Find and connect to a Wii Remote
            WiiRemote remote = WiiRemoteJ.findRemote();
            //WiiRemote remote = WiiRemoteJ.connectToRemote("btl2cap://0017AB29BB7B");
            remote.addWiiRemoteListener(new WRLImpl(remote));
            remote.setAccelerometerEnabled(true);
            remote.setSpeakerEnabled(true);
            remote.setIRSensorEnabled(true, WRIREvent.BASIC);
            remote.setLEDIlluminated(0, true);
       
            remote.getButtonMaps().add(new ButtonMap(WRButtonEvent.HOME, ButtonMap.NUNCHUK, WRNunchukExtensionEvent.C, new int[]{java.awt.event.KeyEvent.VK_CONTROL},
                java.awt.event.InputEvent.BUTTON1_MASK, 0, -1));


And if you want to use the buttons and the accelerometers, you can see the lines 179 and 324, it's quite simple.

I hope be helpful, bye.
Back to top
View user's profile Send private message
manorboy



Joined: 21 Jul 2008
Posts: 3

Digg It
PostPosted: Tue Jul 22, 2008 1:57 pm    Post subject:

Thanks for your help

but when I try WRLImpl.java

BlueCove version 2.0.3-SNAPSHOT on bluesoleil
2008/7/22 下午 09:47:52 wiiremotej.WiiDeviceDiscoverer deviceDiscovered
細緻: Found Nintendo RVL-CNT-01 (001AE9F466E1)
2008/7/22 下午 09:47:52 wiiremotej.WiiDeviceDiscoverer deviceDiscovered
細緻: Nintendo RVL-CNT-01 is a Wii Remote.
2008/7/22 下午 09:47:53 wiiremotej.WiiRemote construct
資訊: btl2cap://001AE9F466E1
2008/7/22 下午 09:47:53 wiiremotej.WiiDeviceDiscoverer getDevice
嚴重的: Error getting device!
java.io.IOException: WiiRemote failed to connect!
at wiiremotej.WiiRemote.construct(WiiRemote.java:304)
at wiiremotej.WiiRemote.<init>(WiiRemote.java:216)
at wiiremotej.WiiDeviceDiscoverer.getDevice(WiiDeviceDiscoverer.java:122
)
at wiiremotej.WiiRemoteJ.findDeviceInternal(WiiRemoteJ.java:270)
at wiiremotej.WiiRemoteJ.findDevice(WiiRemoteJ.java:244)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:285)
at WRLImpl.main(WRLImpl.java:122)
Caused by: com.intel.bluetooth.NotSupportedIOException: Not Supported on bluesoleil
at com.intel.bluetooth.BluetoothStackBlueSoleil.l2OpenClientConnection(B
luetoothStackBlueSoleil.java:426)
at com.intel.bluetooth.BluetoothL2CAPClientConnection.<init>(BluetoothL2
CAPClientConnection.java:33)
at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnec
tor.java:401)
at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.
java:510)
at javax.microedition.io.Connector.open(Connector.java:95)
at wiiremotej.WiiRemote.construct(WiiRemote.java:298)
... 6 more
java.io.IOException: WiiRemote failed to connect!
at wiiremotej.WiiRemote.construct(WiiRemote.java:304)
at wiiremotej.WiiRemote.<init>(WiiRemote.java:216)
at wiiremotej.WiiDeviceDiscoverer.getDevice(WiiDeviceDiscoverer.java:122
)
at wiiremotej.WiiRemoteJ.findDeviceInternal(WiiRemoteJ.java:270)
at wiiremotej.WiiRemoteJ.findDevice(WiiRemoteJ.java:244)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:285)
at WRLImpl.main(WRLImpl.java:122)
Caused by: com.intel.bluetooth.NotSupportedIOException: Not Supported on bluesol
eil
at com.intel.bluetooth.BluetoothStackBlueSoleil.l2OpenClientConnection(B
luetoothStackBlueSoleil.java:426)
at com.intel.bluetooth.BluetoothL2CAPClientConnection.<init>(BluetoothL2
CAPClientConnection.java:33)
at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnec
tor.java:401)
at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.
java:510)
at javax.microedition.io.Connector.open(Connector.java:95)
at wiiremotej.WiiRemote.construct(WiiRemote.java:298)
... 6 more


How do I sovle the problem?

THanks!!
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 522

Digg It
PostPosted: Tue Jul 22, 2008 3:44 pm    Post subject:

Use a WIDCOMM Bluetooth stack. Bluesoleil is a bit buggy. That error may come up sometimes in any case, but if it happens frequently, get the WIDCOMM drivers.
_________________
Cha0s
Back to top
View user's profile Send private message
manorboy



Joined: 21 Jul 2008
Posts: 3

Digg It
PostPosted: Wed Jul 23, 2008 8:23 am    Post subject:

Thanks!!

I solve the problem~
Back to top
View user's profile Send private message
jokane



Joined: 20 Aug 2008
Posts: 3

Digg It
PostPosted: Wed Aug 20, 2008 3:06 am    Post subject: same issue

I am having the same exact issue with BlueSoleil and WIDCOMM. Instead my starts with "Bluecove 2.0.3 on winsocks" when I think I'm using WIDCOMM. Does that mean it's using WIDCOMM?

How did you solve it, did installing the latest WIDCOMM driver work? When I tried that it said that my hardware was not supported.. any other issues? I am able to connect to the Wiimote with Bluesoliel, but it gives me those same error messages. Please help!
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 522

Digg It
PostPosted: Wed Aug 20, 2008 6:27 am    Post subject:

It's using the default driver there. You need to make sure that your computer is using the correct Bluetooth stack in Bluetooth settings.
_________________
Cha0s
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group