Hi there,
I’m trying to read data from an arduino microprocessor which is coming in to my ubuntu computer via usb. I have written a simple program that seems to be working somewhat. I’m using the serialport ruby library and have managed to get information coming in on the terminal. my problem now is that the readings are in characters (possibly extended ascii). I’m wondering how I can convert them to integer.
here is my code: -
require ‘serialport’
ser = SerialPort.new("/dev/ttyUSB0", 9600, 8, 1, SerialPort::NONE)
loop do
puts ser.read(8)
end
and here is an screenshot of the characters: -
thank you very much