|
From: | Kire Pudsje |
Subject: | Re: Serial connection (realtime) |
Date: | Thu, 2 Mar 2017 03:33:05 +0100 |
dataacc = [];untested code, processing chunks of 100 bytes at onceThen (after making sure, you do proper aligning of strings, to prevent cuts between digits), uses = char(data);Looking at the data, I see 13 and 10. These are the ascii values of carriage return and line feed.So the data is just a list of ascii values representing characters.To convert to a string, just do:
val = str2num(s);while true% read datadata="">% append to accumulation bufferdatacc = [datacc, data];% find last line feedidx = find(dataacc == 10);% if something foundif ~isempty(idx)% process data until last linefeed characterval = str2num(char(dataacc(1:idx(end)))); % do something useful with the datadisp(val);% remove processed part from accumulation bufferdataacc(1:idx) = [];endendOn Wed, Mar 1, 2017 at 11:15 PM, Juan Pablo Carbajal <address@hidden> wrote:more information would be needed to detect what the problem is.On Wed, Mar 1, 2017 at 6:25 PM, GuiCintraAlves
<address@hidden> wrote:
> No... but went i use
> #!/bin/bash
> cu -l /dev/ttyACM0 -s 9600
> $SHELL
>
> It works just like the arduino's serial monitor. I hope it's something
> octave ...
>
>
>
> --
> View this message in context: http://octave.1599824.n4.nabble.com/Serial-connection-realti me-tp4682072p4682088.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave
Ideally you could report a bug in the bug tracker.
It seems the serial connection is not being established by the
instrument-control package (I can't reproduce here).
_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |