diff options
| author | alex <aletu130@student.liu.se> | 2019-10-20 15:54:33 +0200 |
|---|---|---|
| committer | alex <aletu130@student.liu.se> | 2019-10-20 15:54:33 +0200 |
| commit | 13f22ba6b4a6e530be779ef96d71850e767e9366 (patch) | |
| tree | 04840aaf2a896a65c8cd2005fcc2019c96f0a6fb /Kod/bilbana/yc4/display/send_data_to_display.m | |
| parent | 483d5184a309a396be7310afcddb913d9e24efe2 (diff) | |
| parent | 7978f8c42029b59e479ec918b67d968b1385081c (diff) | |
| download | tfyy51-13f22ba6b4a6e530be779ef96d71850e767e9366.tar.gz | |
Merge branch 'freeze'
Diffstat (limited to 'Kod/bilbana/yc4/display/send_data_to_display.m')
| -rw-r--r-- | Kod/bilbana/yc4/display/send_data_to_display.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Kod/bilbana/yc4/display/send_data_to_display.m b/Kod/bilbana/yc4/display/send_data_to_display.m new file mode 100644 index 0000000..c5d70c7 --- /dev/null +++ b/Kod/bilbana/yc4/display/send_data_to_display.m @@ -0,0 +1,27 @@ +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) + matlabclient(1, display_data{1}); + last_send = clock; + display_data(1) = []; + end +end |
