I have just finished building a multi robot project that includes 2 NXTs programmed in NXC, and 1 NXT programmed in RobotC. Everything is working great with each independent program, but I need to be able to pass a couple of messages between the NXTs.
I tried setting the RobotC NXT as the master for BT connection with one of the other NXTs as slave (NXC with 1.31 EFW). The NXTs are paired up and have established a connection. The problem is that I have been unable to get any type of message to be sent from the slave to the master.
In the NXC program on the slave NXT I am using the BluetoothWrite function.
x = BluetoothWrite(0, data); // connection to port 0 which is the master
This functions returns the value 32, I have been unable to find what the return codes should be.
In the RobotC program I have tried many different things including:
cCmdMessageRead(nQueueID, nRcvBuffer, nSizeOfMessage);
Can anyone confirm that messaging should work between RobotC and NXC programs?
I can post some actual code snippets if it would help.
BManCan
Bluetooth RobotC to NXC
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Bluetooth RobotC to NXC
I have not tried in a while, but last time I used Robot C, it used a different format for the messages than NXC. At one point, it was set-up for pier to pier communication, not master-slave, like the standard LEGO firmware.
Now that I think about it, in the standard firmware (and EFW), the slave will wait for the master to request a message, before the slave will actually send the message. Robot C does not do that.
Try setting up the NXC NXT as the master, and have it send the message. Robot C should receive it. It may be more involved if you want to send a message back from Robot C to NXC.
Steve
Now that I think about it, in the standard firmware (and EFW), the slave will wait for the master to request a message, before the slave will actually send the message. Robot C does not do that.
Try setting up the NXC NXT as the master, and have it send the message. Robot C should receive it. It may be more involved if you want to send a message back from Robot C to NXC.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: Bluetooth RobotC to NXC
Thanks very much for the guidance. I setup the NXC NXT as the master, and was able to send a BT message to the RobotC NXT with very little difficulty.hassenplug wrote: Try setting up the NXC NXT as the master, and have it send the message. Robot C should receive it. It may be more involved if you want to send a message back from Robot C to NXC.
Steve
I will have to change my strategy slightly. Original plan had RobotC master with two NXC slaves. New plan will be NXC master with one RobotC slave and one NXC slave.
Thanks again.
BManCan
Re: Bluetooth RobotC to NXC
Hi,
Steve is right. but I think there is the possibility in robotC to change BT to a maste slave protocol to support multiple connections in robotC. Look for multiple clients or half duplex in the manual.
Aswin
Steve is right. but I think there is the possibility in robotC to change BT to a maste slave protocol to support multiple connections in robotC. Look for multiple clients or half duplex in the manual.
Aswin
My blog: nxttime.wordpress.com
Re: Bluetooth RobotC to NXC
RC recently supports more than 1+1 NXTs via BT?
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Bluetooth RobotC to NXC
I'm sure Robot C can be configured to send the master-messages, if you want to do that. You'll just have to figure out what those messages need to be.
Steve
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: Bluetooth RobotC to NXC
ok, RC supporting more than 2 bricks connected to each other by BT must be a new feature. In earlier releases that was always limited to 2 (IIRC, 1 master +1 slave).
Re: Bluetooth RobotC to NXC
This is what the robotC manual has to say about it.
RobotC also allows For multiple slave support, but a description of this is beyond the scope of this manual.
My blog: nxttime.wordpress.com
Who is online
Users browsing this forum: No registered users and 3 guests