function data = writeEeprom(H,addr,data)

globalVar;

sendServo(H,WRITE_EEPROM,addr,data,0,0,0,0);
[command,return1] = readServo(H);

if(~(command == WRITE_EEPROM && return1 == 0))
    disp('OPERATION FAILED: Write EEPROM');
end