?? s_out_pop.m
字號:
function v_code_feedback=s_out_pop(n,v)
%v is the value of the voltage
%n is the number of the channel
%v_code=32768+((v*8.8/1.9-2.5)*10^4/2);%計算5622的電壓碼,加運放
v_code=32768+((v-2.5)*10^4/2)%計算5622的電壓碼
s = serial('COM1');
fopen(s)
set(s,'DataBits',8)
s.BaudRate=2400;
fwrite(s,16*(n-1),'uint8')
fwrite(s,v_code,'uint16')
s.BytesAvailable;
v_code_feedback = fread(s,1)
s.BytesAvailable;
fclose(s)
delete(s)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -