ROBOTC.net forums
http://www.robotc.net/forums/

Bluetooth Receiving
http://www.robotc.net/forums/viewtopic.php?f=1&t=11368
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:
Code:
task main()
{
   float barometric;
   float baroMsg = 0.000;
   int Loop = 1;
   sendMessage(101);
  ClearMessage();
   while (Loop == 1) {
      baroMsg = message;
      nxtDisplayTextLine(1, "%5.3f baroMsg", baroMsg);
      if (baroMsg > 0.000) {
         barometric = baroMsg;
         nxtDisplayTextLine(2, "%5.3f barometric", barometric);
         wait1Msec(5000);
         Loop = 1;
      }
      wait1Msec(50);
   }
}


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,
-Smallkitten

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/