start at random position in file
This commit is contained in:
@@ -22,6 +22,8 @@ def open_device
|
||||
rescue
|
||||
p "Serialport Error - reverting to 'example_blurp.txt'"
|
||||
io_device = File.open("example_blurp.txt")
|
||||
# start at random place in the file
|
||||
io_device.seek(rand(1500), IO::SEEK_SET)
|
||||
end
|
||||
return io_device
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user