marvin:ecp5
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
marvin:ecp5 [2009/01/28 17:35] – deva | marvin:ecp5 [2009/01/29 00:16] – rieper | ||
---|---|---|---|
Line 15: | Line 15: | ||
* Make a bluetooth client code Behaviour on the Marvin, that can receive numbers and act on them. | * Make a bluetooth client code Behaviour on the Marvin, that can receive numbers and act on them. | ||
* Make PC bluetooth application read from keyboard arrows to determine control direction. | * Make PC bluetooth application read from keyboard arrows to determine control direction. | ||
+ | |||
=====The protocol===== | =====The protocol===== | ||
Line 20: | Line 21: | ||
From wikipedia: //" | From wikipedia: //" | ||
- | Lejos has built an entire framework for bluetooth communication, | + | LeJOS has built an entire framework for bluetooth communication, |
(([[http:// | (([[http:// | ||
We do not want to go further into the details of the protocol itself, but the way the device is shared can eventually end up in data loss(([[http:// | We do not want to go further into the details of the protocol itself, but the way the device is shared can eventually end up in data loss(([[http:// | ||
- | On the PC Lejos has also made a bluetooth interface. This works exactly the same as the one on the NXT, and we therefore simply had to make a connection (listening on the NXT and connecting on the PC) and then creating input/ | + | On the PC LeJOS has also made a bluetooth interface. This works exactly the same as the one on the NXT, and we therefore simply had to make a connection (listening on the NXT and connecting on the PC) and then creating input/ |
- | Lejos has put a lot of effort into making the bluetooth communication easy to use, and the implementation were therefore quite straight forward. | + | Lejos has put a lot of effort into making the bluetooth communication easy to use, and the implementation were therefore quite straight forward. |
We experienced a lot of slowdown in the balancing thread whenever the bluetooth communication was running, and we had to disable it entirely at numerous occations to avoid the robot falling over.\\ | We experienced a lot of slowdown in the balancing thread whenever the bluetooth communication was running, and we had to disable it entirely at numerous occations to avoid the robot falling over.\\ | ||
Line 92: | Line 93: | ||
</ | </ | ||
- | And on the PC a window (JFrame) captures keyboard input and redirects their keycode values to the bluetooth stream: | + | On the PC, a window (JFrame) captures keyboard input and redirects their keycode values to the bluetooth stream: |
<code java> | <code java> | ||
NXTComm nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH); | NXTComm nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH); |
marvin/ecp5.txt · Last modified: 2009/01/29 10:58 by rieper