Combination Report Einstein Robot



Download 10.84 Mb.
Page29/41
Date conversion08.07.2018
Size10.84 Mb.
1   ...   25   26   27   28   29   30   31   32   ...   41

Developing Bluetooth application in robot C


Send/Receive Messages from NXT brick – this part taken from RobotC manual, for more information see:

http://www.robotc.net/support/nxt/MindstormsWebHelp/index.htm#page=Bluetooth/sendingmessages/Sending%20Messages%20via%20Bluetooth.htm

The NXT firmware automatically receives messages and adds them to a queue of incoming messages. The application program takes the messages from this queue and processes them one at a time. The variables message and messageParm contain the contents of the current message being processed. The function ClearMessage discards the current message and sets up to process the next message.
Example can be found in 'BtBasicMsg.c'
Other simple methods:

cCmdMessageGetSize get the size of the first message in a mailbox containing a queue of received messages. cCmdMessageRead removes the first message from a mailbox queue and copies it to a user buffer. Implementation requires checking for messages periodically and read any incoming messages using cCmdMessageRead. Then interpretate this message and translate it into instructions.

Example can be found in ‘NXT BT Messaging No Error Checking.c'



For Pc-side code, see implementation below in Visual Basic for details.





1   ...   25   26   27   28   29   30   31   32   ...   41


The database is protected by copyright ©dentisty.org 2016
send message

    Main page