%Comunicações
BAUD        = 57600;        %57600;
DATABITS    = 8;
STOPBITS    = 2;
PARITY      = 'none';
HANDSHAKE   = 'none';
PORT        = 'COM1';

MSG_LENGTH  = 8;
SERVO_SEL   = 1;
SENSOR_SEL  = 2;

N_SENSOR    = 4;

%Caracteristicas
ANGLE_MIN       = -90;
ANGLE_MAX       = 90;
ANGLE_RANGE     = (ANGLE_MAX-ANGLE_MIN);
VAL_ANGLE_MIN   = 600;
VAL_ANGLE_MAX   = 2400;
VAL_ANGLE_RANGE = (VAL_ANGLE_MAX-VAL_ANGLE_MIN);
ANGLE_TOL       = 1;
SPEED_MIN       = 1;
SPEED_MAX       = 100;

%Campo "Command"
TESTAR              = 1;
READ_EEPROM         = 2;
SET_SPEED_READ_POS  = 3;
SET_POS_ID          = 4;
RELEASE             = 5;
N_SERV              = 6;
%MAX_SPEED           = 7;
DIR_KIN             = 7;
INV_KIN             = 8;
N_VALUES            = 9;

%Máscaras
MASK_HIGH = hex2dec('FF00');
MASK_LOW  = hex2dec('00FF');

%Endereços EEPROM
ID_ADDR    = hex2dec('29');
CS_ADDR    = hex2dec('2C');
SPEED_ADDR =      6;

%Endereços Memória
CUR_TRAJ_LOW_MEMADDR  = 6;
CUR_TRAJ_HIGH_MEMADDR = 7;

%Resolução da Tensão
V_RESOLUTION = 0.03522;

%Physical measures
L0      = 50;
L1      = 139;
L2      = 143;