use '!' as end of frame sync

This commit is contained in:
Aart van Halteren
2013-06-26 16:45:00 -04:00
parent 5e1712afac
commit 6443d70bcf
2 changed files with 7 additions and 5 deletions

View File

@@ -14,8 +14,8 @@ ActiveRecord::Base.establish_connection(connection_details)
# # Open connection to serial port
ser = SerialPort.new("/dev/ttyUSB1", 9600, 7, 1, SerialPort::EVEN)
lines = ""
for i in 0..22
lines = lines+ser.readline("\n").gsub(/\r/, '')
for i in 0..21
lines = lines+ser.readline("\n").gsub(/\r/, '')
end
# # read until newline