Canreef Aquatics Bulletin Board  

Go Back   Canreef Aquatics Bulletin Board > General > Reef

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #27  
Old 02-24-2002, 03:11 PM
titus's Avatar
titus titus is offline
Administrator
 
Join Date: Aug 2001
Location: Hong Kong
Posts: 3,163
titus has disabled reputation
Default input needed. VHO testing...

Hello,

Is it easy for you to build a cheap simple low speed ADC interface for the serial port? Matlab has serial access functions and the following code sample serve to illustrate how we can use our computers with a simple interface to do continuous data sampling.

Assuming that we want to take a sample every 60 seconds with a timing resolution of 'res':

% Code Snippet
res = 0.5;
previous_time = 0;
current_time = clock;

if [etime[current_time, previous_time) < 60)
pause[res);
current_time = clock;
else
previous_time = current_time;
% Trigger and sample ADC
current_time = clock;
end
% Code Snippet
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.