📄 s_out_ini.m
字号:
function shakehand=s_out_ini
%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,170,'uint8')%输出握手信号AA
fwrite(s,170,'uint16')
%s.BytesAvailable
readasync(s);
shakehand = fread(s,1)
s.BytesAvailable;
%get(s,{'BaudRate','DataBits','Parity','StopBits','Terminator'})
fclose(s)
delete(s)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -