Commit c5ed4e51 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

added lightviewer

parent da87a8b3
......@@ -7,17 +7,15 @@ function pb_lightshow(leds)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
import org.zeromq.ZMQ
n = 8;
s = ledpattern(n);
seq1 = [0:2:9 fliplr(16:2:24)];
seq2 = [1:2:9 fliplr(17:2:24)];
n = 8;
s = ledpattern(n);
ir = 50;
ig = ir;
ir=100;
ig=ir;
seq1 = [0:2:9 fliplr(16:2:24)];
seq2 = [1:2:9 fliplr(17:2:24)];
for i=1:n
if mod(i,2) == 0
......
function pb_lightviewer(varargin)
% PB_LIGHTVIEWER
%
% PB_LIGHTVIEWER(varargin) simulates lightshows in the vestibular chair
%
% See also PB_LIGHTSHOW
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
h = pb_keyval('fig',varargin,pb_newfig(998));
lightshow = pb_keyval('lightshow',varargin,'default');
leds = pb_keyval('leds',varargin,-45:5:45);
freq = pb_keyval('freq',varargin,.15);
clf; hold on;
axis square
set(gca,'Color','k')
set(gca,'YTickLabel',[]);
set(gca,'XTickLabel',[]);
set(h, 'Units', 'Normalized');
set(h, 'OuterPosition', [.1, .1, .85, .85]);
xlim([-50 50]);
switch lightshow
case 'default'
ls = struct;
ls(1).seq = 1:2:19;
ls(2).seq = 2:2:18;
end
run_show(h,ls,leds,freq);
end
function run_show(h,ls,leds,freq)
n = 8;
for idx = 1:n
if mod(idx,length(ls)) == 0
x = ls(1).seq;
y = zeros(length(x));
plot(leds(x),y,'og','MarkerFaceColor','g');
pause(freq);
cla;
pause(freq);
else
x = ls(2).seq;
y = zeros(length(x));
plot(leds(x),y,'or','MarkerFaceColor','r');
pause(freq);
cla;
pause(freq);
end
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
function pb_delobj(varargin)
% PB_DELOBJ
%
% PB_DELOBJ(varargin) will delete all objects parsed.
% PB_DELOBJ(varargin) will delete all objects parsed.
% On OS X it is also possible to use: delete([obj1,obj2,obj3...])
%
% See also DELETE
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
if nargin == 0; return; end
for idx = 1:length(varargin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment