Ruby简单的串口通信

2014-11-12 0 115
Ruby简单的串口通信
def serialport_command(command)
	result = ""
	File.open("COM3","w+") do |sp|
		sp.write(command)
		while char = sp.read(1)
			result += char
			break if result.upcase.include?("ENDEND")
		end
	end
	result
end

遇见资源网 ruby Ruby简单的串口通信 http://www.ox520.com/16143.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务