Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to use Octave and an add on package called Instrument Control (http://wiki.octave.org/Instrument_control_package) to read in serial data through the USB port. Right now I'm just sending test data through the port. Zeros and ones.

I'm getting correct data through the USB when I use Screen: screen /dev/ttyUSB1

I get strange data when I try to use octave though. I think I'm doing something wrong. Here's an example. I think I should be getting 0 or 1 from srl_read

> pkg load all
> s1 = serial("/dev/ttyUSB1", 9600)
s1 = 3
> srl_read(s1,1)
ans = 49
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You are reading the ASCII value of "1" from the serial port in this case:

octave:1> x = double ("1")
x =  49

Answer taken from the help-octave mailing list, where the developer of instrument-control answered your question more thoroughly.

share|improve this answer
    
Thanks. The answer from the mailing list works. –  JDD Oct 25 '12 at 11:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.