📄 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 + -