Bluetooth Receiving
Page 1 of 1

Author:  smallkitten [ Mon Jun 01, 2015 8:22 pm ]
Post subject:  Bluetooth Receiving

We have written a program to send a message from one NXT to another to get a sensor value. However, we are running into trouble when trying to get the value back on the first NXT who asked for the value (the other NXT should have received a number "101" to which it should send the value back).
This is the code on that NXT:
task main()
   float barometric;
   float baroMsg = 0.000;
   int Loop = 1;
   while (Loop == 1) {
      baroMsg = message;
      nxtDisplayTextLine(1, "%5.3f baroMsg", baroMsg);
      if (baroMsg > 0.000) {
         barometric = baroMsg;
         nxtDisplayTextLine(2, "%5.3f barometric", barometric);
         Loop = 1;

When we run the two programs, we know that one of the NXTs receives the "101" and checks the sensor value, displaying it on the screen. The other NXT, however, does not seem to be receiving the message sent back with the value.

Thanks for your help,

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group