start at random position in file
This commit is contained in:
@@ -22,6 +22,8 @@ def open_device
|
|||||||
rescue
|
rescue
|
||||||
p "Serialport Error - reverting to 'example_blurp.txt'"
|
p "Serialport Error - reverting to 'example_blurp.txt'"
|
||||||
io_device = File.open("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
|
end
|
||||||
return io_device
|
return io_device
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user