Skip to content

Commit a5049a8

Browse files
committed
Enclose use of timescope in conditional
Signed-off-by: Julia Pineda <Julia.Pineda@analog.com>
1 parent 56474c9 commit a5049a8

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

sensor_examples/adis16460_motion.m

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,24 @@
1414
% Scopes
1515
N = 64;
1616
viewer = HelperOrientationViewer;
17-
ts = dsp.TimeScope;
18-
ts.SampleRate = fs;
19-
ts.TimeSpanOverrunAction = 'Scroll';
20-
ts.TimeSpan = 1/fs*N;
21-
ts.NumInputPorts = 2;
22-
ts.ShowLegend = true;
23-
ts.ChannelNames = {'Acceleration X','Acceleration Y','Acceleration Z',...
24-
'Angular Velocity X','Angular Velocity Y','Angular Velocity Z'};
25-
ts.ShowGrid = true;
26-
ts.LayoutDimensions = [2 ,1];
27-
ts.AxesScaling = 'Auto';
28-
ts_parts = clone(ts);
29-
ts_parts.LayoutDimensions = [1 ,1];
30-
ts_parts.NumInputPorts = 4;
31-
ts_parts.ChannelNames = {'W','X','Y','Z'};
32-
17+
useScope = true;
18+
if useScope
19+
ts = dsp.TimeScope;
20+
ts.SampleRate = fs;
21+
ts.TimeSpanOverrunAction = 'Scroll';
22+
ts.TimeSpan = 1/fs*N;
23+
ts.NumInputPorts = 2;
24+
ts.ShowLegend = true;
25+
ts.ChannelNames = {'Acceleration X','Acceleration Y','Acceleration Z',...
26+
'Angular Velocity X','Angular Velocity Y','Angular Velocity Z'};
27+
ts.ShowGrid = true;
28+
ts.LayoutDimensions = [2 ,1];
29+
ts.AxesScaling = 'Auto';
30+
ts_parts = clone(ts);
31+
ts_parts.LayoutDimensions = [1 ,1];
32+
ts_parts.NumInputPorts = 4;
33+
ts_parts.ChannelNames = {'W','X','Y','Z'};
34+
end
3335
%% Get info
3436
numSamples = IMU.SamplesPerFrame;
3537
t = 0:1/fs:(numSamples-1)/fs;
@@ -41,13 +43,17 @@
4143
viewer(qimu);
4244
pause(0);
4345
end
44-
ts(acc(ii,:), gyro(ii,:));
45-
[w,x,y,z] = qimu.parts;
46-
ts_parts(w,x,y,z);
46+
if useScope
47+
ts(acc(ii,:), gyro(ii,:));
48+
[w,x,y,z] = qimu.parts;
49+
ts_parts(w,x,y,z);
50+
end
4751
end
4852

4953
%% Cleanup
5054
release(ifilt);
5155
release(IMU);
5256
release(viewer);
53-
release(ts);
57+
if useScope
58+
release(ts);
59+
end

sensor_examples/adis16480_motion.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@
5555
release(ifilt);
5656
release(IMU);
5757
release(viewer);
58-
% release(ts);
58+
if useScope
59+
release(ts);
60+
end

0 commit comments

Comments
 (0)