//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

// Remote control (slave)

#include "XbeeTools.h"

task main()
{
  InitRS485();

  string messageReceived;

  while(true)
  {
    ReceiveString(messageReceived);
    nxtDisplayTextLine(1, "%s", messageReceived);

    if (StringFind(messageReceived, "R1RTLT") >= 0)
    {
      motor[motorB] = 50;
      motor[motorC] = 50;
    }
    if (StringFind(messageReceived, "R1RTLF") >= 0)
    {
      motor[motorB] = 50;
      motor[motorC] = 0;
    }
    if (StringFind(messageReceived, "R1RFLT") >= 0)
    {
      motor[motorB] = 0;
      motor[motorC] = 50;
    }
    if (StringFind(messageReceived, "R1RFLF") >= 0)
    {
      motor[motorB] = 0;
      motor[motorC] = 0;
    }
  }

}
