Open ghost opened 10 years ago
I know 5 years old but it seems a simple question that should have been answered
I got the same thing.
try replacing miniterm.rb with...
require "../serialport.so"
require "rubygems"
require "serialport"
if ARGV.size < 4
STDERR.print <<EOF
Usage: ruby #{$0} num_port bps nbits stopb
EOF
exit(1)
end
sp = SerialPort.new(ARGV[0], ARGV[1].to_i, ARGV[2].to_i, ARGV[3].to_i, SerialPort::NONE)
open("/dev/tty", "r+") { |tty|
tty.sync = true
Thread.new {
while true do
tty.printf("%c", sp.getc)
end
}
while (l = tty.gets) do
sp.write(l.sub("\n", "\r"))
end
}
sp.close
in lib/serialport
type ruby ../../test/miniterm.rb "/dev/ttyACM0" 1200 8 1
or something. That worked for me.
When I run the test, I get the following output:
Does that make sense? It is trying to run:
but the new method is looking for 2 args, looking at api docs:
(SerialPort) new(port, *params)