neesha
Newbie level 4
- Joined
- Jul 19, 2013
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 43
This is my codes for base workspace in MATLAB. the codes turns ON the pump. BUT it does not work when i used this is GUI. can anyone help me on what modification should i do in order to make the pump to turn ON when it is controlled using GUI?
s = serial ('COM7');
set (s,'Baudrate',1200,'Parity','even');
set (s,'DataBits',8);
set (s,'Stopbits',1);
fopen(s);
txdata = ['E9';'01';'06';'58';'4C';'00';'C8';'01';'01';'DB'];
txdata_dec = hex2dec(txdata);
fwrite(s,txdata_dec,'unit8')
s = serial ('COM7');
set (s,'Baudrate',1200,'Parity','even');
set (s,'DataBits',8);
set (s,'Stopbits',1);
fopen(s);
txdata = ['E9';'01';'06';'58';'4C';'00';'C8';'01';'01';'DB'];
txdata_dec = hex2dec(txdata);
fwrite(s,txdata_dec,'unit8')