put serial_port in blocking read
This commit is contained in:
@@ -17,6 +17,8 @@ def open_device
|
||||
begin
|
||||
# Open connection to serial port
|
||||
io_device = SerialPort.new("/dev/ttyUSB1", 9600, 7, 1, SerialPort::EVEN)
|
||||
# Make reading blocking
|
||||
io_device.read_timeout = 0
|
||||
rescue
|
||||
p "Serialport Error - reverting to 'example_blurp.txt'"
|
||||
io_device = File.open("example_blurp.txt")
|
||||
|
||||
Reference in New Issue
Block a user