Post your NXJ projects, project ideas, etc here!
Moderators: imaqine, 99jonathan, roger
Hi there. My team has decided to make a NXT robot that we can control From a PC using bluetooth.
I'm having trouble sending information from my PC to my NXT. If I can do that, I'm sure we'll be able to program some UI for the PC, and get the motors and sensors to work on the NXT side.
So.. If anyone could paste some code doing the following:
Open BT connection.
Send and int value (or byte or whatever?)
Recieve int and print it on screen
Please include the import lines that I would need, as I'm often having library problems :/
Just so I don't get a standard answer; I have read the sample codes and the pctools, but I can't figure out how to use them (too complex codes, or non working codes :/). And my classpaths are correct.
- New User
- Posts: 4
- Joined: Wed Oct 17, 2007 10:34 am
You should just use iCommand. It does everything you want. There are some samples when you download it.
- Site Admin
- Posts: 384
- Joined: Fri Aug 04, 2006 4:03 pm
I'm a bit confused, what's the difference between iCommand and leJos ?
I thought LeJos was an enhanced version of iCommand, you can control your nxt trough bluetooth with leJos can't you ?
- New User
- Posts: 1
- Joined: Tue Feb 19, 2008 6:12 pm
ICOMMAND runs on your PC.
If you write your programs for your pc using icommand in it you can directly access the NXT Brick and control it as well as get information back from the bricks sensors.
When you write a program with the lejos classes they will only execute on the NXT Brick.
There is tons of information about this online,
If you look in side the incommand folder you will find a folder called "samples" there are several classes that you will find helpful, fun and very useful for what you want.
There is one specific class in the samples folder called "RemoteControl.java" it allows you to use the arrow keys on your keyboard to control the NXT via bluetooth.
What i done was i modified this class to include a LightSensor object so that i could also extract data from my light sensors.
If you want to control the nxt from the pc and get data from just write a program that executes on your pc include the relevant icommand stuff.
definitly have a look at the samples folder there is lots of useful stuff in those classes.
- Active User
- Posts: 81
- Joined: Tue Oct 16, 2007 7:28 pm
- Location: Prague
Return to NXJ Projects
Who is online
Users browsing this forum: No registered users and 2 guests