To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 377
376  |  378
Subject: 
Sending/receiving messages
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Tue, 11 Jan 2005 23:05:42 GMT
Viewed: 
6696 times
  
Hi guys, I have a project where I am using 2 spybots in one robot. I need one
spybot to send a "GO" message to the other and to wait until it gets confirmed
and do an action together. I have tryed to understand what I read in the help
file but I still have no clue how to do it in NQC. Please give me some simple
line codes on how to do it for both spybots. What I want them to do looks like
this:

// first spybot
if (x==1)
{
  SendMessage(some number...);
  Wait(20);
  // check for confirmation - no ideea how to do it...
  start follow_line();
}

// second spybot
// check for message... if found, y=1
if (y==1)
{
  //send confirmation
  start sorting();
}

As you can see, I need simple code lines there but have no clue how to do them.
And I don't know if and how shoud I initialise for sending messages.

Please help me with this, it is verry important for a competition this saturday.

Thanks,

Gabe



Message has 1 Reply:
  Re: Sending/receiving messages
 
Gabe, I think you want something like this: // first spybot if (x==1) { SendMessage(SORT_NUMBER); while (Message()!=SORT_CONFIRM); start follow_line(); } --- // second spybot if (Message()==SORT_NUMBER) { //send confirmation (...) (19 years ago, 11-Jan-05, to lugnet.robotics.spybotics)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR