View unanswered posts | View active topics It is currently Wed Jul 23, 2014 11:44 am






Reply to topic  [ 2 posts ] 
Bluetooth/USB communication between computer and nxt 
Author Message
Rookie

Joined: Sat Jan 18, 2014 6:58 pm
Posts: 2
Post Bluetooth/USB communication between computer and nxt
Hi,

I am working on a robot that has to receive commands from a computer. I know this has been discussed multiple times, but despite all I've read I'm not getting it to work. I program in vb.net for some years now, and have less experience with c but no problems here. I am able to program a robot in c with no difficulties, my problem has always been with making devices communicate to each other.

Now here is the problem, I tried using code from here: http://www.extremenxt.com/vbfront.htm and from here: http://www.codeproject.com/Articles/18857/Communicating-with-LEGO-NXT-via-Bluetooth-in-C the first being in vb.net and the last being in c#, they are very similar, but have slight differences.

I get the PC talking to the NXT with no problems, but if i send a message to a NXT mailbox, I am only able to read it with the command "message" and not with "cCmdMessageRead". if I say "cCmdMessageGetSize" it returns 0, but if I say "message" it returns the message normally! I want to use "cCmdMessageRead" because I saw it can read up to 58 8-bit Bytes at once whereas "message" can only read one 16-bit byte (2 8-bit bytes), and because i want to be able to read each Byte separately. I know the "cCmdMessageRead" syntax perfectly, and know the output is in ubytes, so that is not a problem, the thing is that it acts like there is not even a message to read. I even tried sending only the message Bytes without those 6 Bytes before it that tell the NXT what to do, just to try, but obviously that went even worse, and I was not even able to read it with the "message" command, maybe i could use that with the "nxtReadRawBluetooth" command!? Why would I be able to read it with one command while the other tells me there is no message to read? Is there a bug, or am I doing something wrong? And what about "nxtReadRawBluetooth", how does that work, and would it be useful for me?

And about the USB thing:
Ideally I wanted the PC to Talk to the NXT through USB, to avoid delays, but i gave up on that, considering it is much harder than Bluetooth. But if anyone has any advice on USB message sending from the PC to the NXT, that would be appreciated.

Ps.: I am using RobotC 3.54

Thanks in advance,

Luca


Sat Jan 18, 2014 8:06 pm
Profile
Rookie

Joined: Sat Jan 18, 2014 6:58 pm
Posts: 2
Post Re: Bluetooth/USB communication between computer and nxt
I already solved my problem, using raw bluetooth mode.
Could some admin please close this thread?!
Thanks.


Thu Jan 23, 2014 4:35 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: jerrykern and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.