Rubyでシリアル通信
参考
インストール
gem install serialport
シリアル通信を行う
require 'rubygems'
gem 'serialport','>=1.0.4'
require 'serialport'# 9600bps, 8bit, stopbit 1, parity none
sp = SerialPort.new('/dev/tty.usb-serialdevice', 9600, 8, 1, 0)
line = sp.gets
a << 'a'
a << 'b'
sp.puts a
が動かない。
「gem list」にはserialportがあるのに、
ロードできない?