So, if you find something that is not 0, that’s the value that was sent by the other NXT. If there’s no message, you’ll find 0 as the message. The only issue here is that this mailbox will hold only one email, so old messages are overwritten when new ones come in. You won’t miss it, it will be in the mail box. So, there’s no need to check every milisecond of the day. But like email, messages are stored for your review until you open them. You’ll never know you’ve got a new email unless you check. Think of it as emails you get from a friend. The key is that you have to keep looking for messages on the receiver part.
#ROBOTC IF ELSE CODE#
I’ve added some comments to the code to help you understand what each portion of the code does. When you do this, the number 23 shows up on the receiving NXT.
(Only the first time) Go to Bluetooth > Search.Connect the NXT’s using the menu on the NXT brick:.You can just copy paste the code from below, or download all 4 sample programs.Newer versions may have issues with this code.