フィルターのクリア

Real time data acquisition with Bluetooth

4 ビュー (過去 30 日間)
Theodora Chivu
Theodora Chivu 2021 年 4 月 7 日
I'm trying to acquire ECG signals real time using Bluetooth HC-05. In Arduino IDE I get 150 samples/second, but here I get 50-60 samples/seconds. The function drawnow its delaying my aquisition a lot and I lose a part of the signal. I tried drawnow limitrate but sometimes its giving me some random samples. Can I make it faster, I want to get 150 samples/second. And another question is how does that fscanf work? If "b" is an object can't i access every value received from the object like b.Value or something like that?
b = instrfind('Type', 'bluetooth', 'Name', 'Bluetooth-HC-05:1', 'Tag', '');
if isempty(b)
b = Bluetooth('HC-05', 1);
else
fclose(b);
b = b(1);
end
fopen(b);
figure
h = animatedline;
ax = gca;
ax.YGrid = 'on';
i=1;
x = zeros();
stop = false;
startTime = datetime('now');
while ~stop
% Read current voltage value
x(1,i) = str2double(fscanf(b));
% Get current time
t = time2num((datetime('now') - startTime),'seconds');
% Add points to animation
addpoints(h,t,x(1,i))
drawnow
i = i+1;
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by