Console Cmd: Main
updated on 06-11-2009

dsNav communication

Detailed commands description
Sensors group commands

Commands (Cmd field) are one single character long and case sensitive.           

In following list:

- r        this is a command that request parameters reading from dsNav to the master

- w       this is a command that writes parameters to dsNav from the master

- TX    these are the parameters sent from supervisor and received by dsNav

- RX    these are the data sent back by dsNav after a correct decoding of the command and received by external board or PC.

The TxData and RxData procedures will be used as example. The code examples are written in Processing language on the PC side.

d

- w

Distance from objects and target readings on three sides coming from sensors board

            - TX:

                        CmdLen = 9 , Params 8 (6 bytes + 1 int)      

Example in Arduino language:

void DataPrint(void)

{// send read data on serial port to Navigation Control Board

  int i;                      // generic index

  byte TxBuff[16];

  byte ChkSum=0;

  TxBuff[0] = 64;             // Header = "@"

  TxBuff[1] = 0;              // Id = 0

  TxBuff[2] = 100;            // command = "d"

  TxBuff[3] = 9;              // command length

  TxBuff[4] = Dist[L];        // data 0

  TxBuff[5] = Dist[C];        // data 1

  TxBuff[6] = Dist[R];       // data 2

  TxBuff[7] = Target(L);      // data 3

  TxBuff[8] = Target(C);      // data 4

  TxBuff[9] = Target(R);      // data 5

  TxBuff[10]= (byte)(CmpBearing >> 8);// data 6

  TxBuff[11]= (byte)(CmpBearing); // data 7 (data 6 + 7 = int)

  for (i=0; i<=11; i++)

  {

    ChkSum += TxBuff[i];

    Serial.print(TxBuff[i], BYTE);

  }

  Serial.print(ChkSum);

}

            - RX:

                        N/A