%Read memory
%
%Read one byte from the controllers volatile memory.
%
%Readable addresses are 0..0xFF. Known memory addresses are
%tabulated below.

function return1=readMem(H,addr)

globalVar;
servoReturn2 = 3;

command = READ_MEM;
param1 = addr;
param2 = 0;
checksum = 256 - mod((STARTBYTE+command+param1+param2),256);

sendMessage(H,command,param1,param2,checksum);
[return1,return2]=readMessage(H);

if(servoReturn2 ~= return2)
    err=ERR_READ_MEM;
    errfcn(H,err);
end
