Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Serial Accelerometer
Date: Tue, 20 Oct 2009 14:15:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <hbkgl6$bn4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256048103 12004 172.30.248.37 (20 Oct 2009 14:15:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 20 Oct 2009 14:15:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2050151
Xref: news.mathworks.com comp.soft-sys.matlab:578706


Hi,

I'm having a tough time with this serial port. I've surfed the forums for a while now and can't get anything working.

I'm trying to have a serial accelerometer work with MATLAB. Wrote some m-file code that would do this and it almost worked. The accelerometer data was being plotted decently; taking the area underneath the curve gave velocity and integrating it further gave the distance...which is our final goal..getting the distance moved. We got this to work with real-time data. As the accelerometer was moving, data was being plotted. The velocity was being done by the 'trapz' function. Not good enough data though, the velocity wasn't being plotted properly.

So now we're trying to use Simulink to solve this problem and hopefully get it to work in real time a bit better. Question is, where do I begin?
How can I get Simulink to read data from the serial port (accelerometer) and plot the data in real time?

Any help would be appreciated :)