Example to turn on the input 2:
Serial_write(0x02);
Serial_write(0x01);
Example to read output 3:
Serial_write(0x13);
valor=Serial_read(0);
Example to write the value 230 on analog input 1:
Serial_write(0x21);
valor=230;
Serial_write((valor&0xFF00)>>8);
Serial_write(valor&0x00FF);
Example to read analog output 2:
Serial_write(0x32);
valorh=Serial_read(0);
valorl=Serial_read(0);
valor=(valorh<<8)|valorl;
def:espmsim