Program nxt via bluetooth




















Add a comment. Active Oldest Votes. It does not explicitly mention Bluetooth, but it is one of features that is not supported. Improve this answer. Community Bot 1. David Lechner David Lechner 8, 14 14 silver badges 52 52 bronze badges. That's unfortunate. Does Lego no longer support NXT 2. I am running Mac OS X Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. In the Receive Message Block, we can compare the message we have received and also, if we expand it, we can take this Boolean variable which will be True if there is a message received and False otherwise. If we get back to the Send My Block, things are quite simple. We have this loop which is again repeated forever and we send the value of the X variable to the brick on connection 1.

We say that we send a number and we send it to mailbox 1. After we have sent the value we wait for 0. This is because otherwise we'll send the values too fast and the other brick will fail. So, now let's get back to the slave brick program. The only thing left is the Receive My Block.

We have this Receive Message Block inside it from which I get the Boolean value showing whether the message is received or not.

If the message is received, I use a switch block to store the value of the message in the X variable. Otherwise, I do nothing and continue repeating the loop.

As I said, the two bricks should be paired before starting the program. So, I'll start both bricks; then go to the Bluetooth menu on both of them and turn on their Bluetooth.

Now both of them have their Bluetooth enabled. This is indicated by this icon. And now I'll go to the search menu of the "Favorit" brick because it will be the master brick. There I will search for the slave brick - in our case "". Now we wait until it finds the other brick.

It has found , so I'll select it. Then I select Port 1. I want to establish connection between the two bricks on Port 1. Now the two bricks are paired and ready to communicate. I go to My Files and start the programs in order to check how they work.

As you see, the program works perfectly. Now I'll turn off the bricks and then start them once again. Once I have paired the two bricks, all I need to do now is to go to the Bluetooth menu of the master brick and then to My Contacts and select the slave brick in our case Select Connect and again select Port 1.

The two bricks are now connected, so I can run the program. In the end, I will run the program once again in order to be sure that everything is just fine. The program is working properly. The next thing to do is to try the communication. This will always work, whatever the program running on the NXT brick. To try the mailboxes communication, I have written a Lego Mindstorm program, mailboxTest.

This allows me to test the in and out mailbox communication. Note that to write to the PC, i. Hint 1 : I confirm what many other people have reported: Bluetooth communication with Lego NXT is very sensitive to the Bluetooth drivers used. Most of the time, it is strongly recommended to NOT install -- or if they are already installed, to uninstall -- the drivers provided by the Bluetooth adapter manufacturer and to use the Microsoft Bluetooth default drivers instead.

The communication via Bluetooth with the NXT brick is very easy.



0コメント

  • 1000 / 1000