[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Realtime plot of floating point data from Serial
From: |
Andreas Weber |
Subject: |
Re: Realtime plot of floating point data from Serial |
Date: |
Mon, 26 Feb 2018 06:23:48 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Am 25.02.2018 um 21:36 schrieb borabut:
> Im having trouble getting a real time plot of my serial data on Octave. Im
> ...
> tuning. Right now my arduino code is just dummy code that writes sine wave
> data over serial. The arduino plotter works fine, showing a perfect sine
> wave but octave shows garbage data.
>
> <http://octave.1599824.n4.nabble.com/file/t372752/data.png>
>
> Obviously these data points are wrong since sine wave can only be between -1
> and 1, and arduino plotter shows exactly that. What am I doing wrong that my
> floating point values are getting mangled in Octave?
Since you don't have any synchronisation, the byte stream between the
arduino and your PC seems to be shifted some (1-3) Bytes.
The quick and dirty way is to power down the arduino, restart Octave and
your program and then power on the arduino. Of course the serial_put on
the ardiono side is only allowed to send floats, no status message,
nothing else.
Btw, adding code and data via a paste service is much better than adding
screenshots
Andy