Bluetooth Recieve Example Program

The trick is to use the information output data plugs (text, number or logic) ONLY when you know you have received a message.

Bluetooth receive message block data output plugs

To do so, use the "Message Received" output data plug. This data plug will say 'true' if there is a valid message waiting or 'false' if not. Pipe this plug into a logic switch as shown below.

Bluetooth receive message block message received plug

Finally, when you use the bluetooth receive block, some bricks will erase the message from the mailbox after it puts it out the data plug. Since you can't pass a data wire through and into a switch, you will need to write the message data into a variable (suitcase block). Then on the 'true' branch of the switch, you can read the saved message out of the variable.

Here is an bare-bones example program that loops waiting for numeric messages from the master:

Example bluetooth receive program