summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana/yc4/display/send_data_to_display.m
blob: 50af84fff4f720a23f49fe925a3443cc2c200e19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [] = send_data_to_display()
%SEND_DATA_TO_DISPLAY sends available data to display if last send was
%                     more than 0.5 seconds ago.
    persistent last_send;
    global display_data;
    
    if isempty(display_data)
        return
    end
    % disp(last_send);
    % disp(clock);
    if isempty(last_send)  % first send
        %% SEND DATA
        % disp('sending data');
        % disp(display_data)
        matlabclient(1, display_data{1});
        last_send = clock;
        display_data(1) = [];
    elseif (etime(clock, last_send) >= 0.5)
        %% SEND DATA
        % disp('sending data');
        % disp(display_data)
		
		data = [];
		

        matlabclient(1, display_data{1});
        last_send = clock;
        display_data(1) = [];
    end
end