summaryrefslogtreecommitdiffstats
path: root/Kod/display
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.li.se>2019-10-19 16:16:21 +0200
committerGustav Sörnäs <gusso230@student.li.se>2019-10-19 16:16:21 +0200
commit4d0480a2e07c92b200fe3bb87e929d970f9e212b (patch)
tree927f39e044e4fa2263af294cb8e20db9067141fa /Kod/display
parent18d4a7ebf4b10fe70cd33fd490846736f561605b (diff)
downloadtfyy51-4d0480a2e07c92b200fe3bb87e929d970f9e212b.tar.gz
Create basic functions for BP4a
Diffstat (limited to 'Kod/display')
-rw-r--r--Kod/display/display_exempel.m114
1 files changed, 57 insertions, 57 deletions
diff --git a/Kod/display/display_exempel.m b/Kod/display/display_exempel.m
index c920087..5ac7cb0 100644
--- a/Kod/display/display_exempel.m
+++ b/Kod/display/display_exempel.m
@@ -10,24 +10,24 @@ cd ClientServerApp\Release
!startServer
cd ../..
%% Diagonal linje
-DC1 = 17;
-ESC = 27;
-Code = 'GD';
-
-% x1, y1, x2, y2, (320 x 240 pixlar)
-% minst signifikanta bitar till vänster
-% mest signifikanta bitar till höger
-arg = [0, 0, 0, 0, 63, 1, 239, 0];
-
-% Save the 'small package' as a string
-data = [ESC, double(Code), arg];
-len = length(data);
-initStr = [DC1, len, data];
-bcc = mod(sum(initStr), 256);
-str = [initStr, bcc];
-
-% Skriv
-matlabclient(1, str')
+% DC1 = 17;
+% ESC = 27;
+% Code = 'GD';
+%
+% % x1, y1, x2, y2, (320 x 240 pixlar)
+% % minst signifikanta bitar till vänster
+% % mest signifikanta bitar till höger
+% arg = [0, 0, 0, 0, 63, 1, 239, 0];
+%
+% % Save the 'small package' as a string
+% data = [ESC, double(Code), arg];
+% len = length(data);
+% initStr = [DC1, len, data];
+% bcc = mod(sum(initStr), 256);
+% str = [initStr, bcc];
+%
+% % Skriv
+% matlabclient(1, str')
%% Rita en rektangel som är fylld med mönster
DC1 = 17;
@@ -53,30 +53,30 @@ str = [initStr, bcc];
matlabclient(1, str')
%% Skriv en Test-sträng
-DC1 = 17;
-ESC = 27;
-Code = double('ZL');
-
-% x1, y1, (320 x 240 pixlar)
-% minst signifikanta bitar till vänster
-% mest signifikanta bitar till höger
-arg1 = [117, 0, 32, 0];
-
-% Textsträng
-%arg2 = 'Test';
-
-arg2 = 'DISPLAY!!!!!';
-
-% Null
-arg3 = 0;
-
-
-% Save the 'small package' as a string
-data = [ESC, double(Code), arg1, double(arg2), arg3];
-len = length(data);
-initStr = [DC1, len, data];
-bcc = mod(sum(initStr), 256);
-str = [initStr, bcc];
+% DC1 = 17;
+% ESC = 27;
+% Code = double('ZL');
+%
+% % x1, y1, (320 x 240 pixlar)
+% % minst signifikanta bitar till vänster
+% % mest signifikanta bitar till höger
+% arg1 = [117, 0, 32, 0];
+%
+% % Textsträng
+% %arg2 = 'Test';
+%
+% arg2 = 'DISPLAY!!!!!';
+%
+% % Null
+% arg3 = 0;
+%
+%
+% % Save the 'small package' as a string
+% data = [ESC, double(Code), arg1, double(arg2), arg3];
+% len = length(data);
+% initStr = [DC1, len, data];
+% bcc = mod(sum(initStr), 256);
+% str = [initStr, bcc];
% Skriv
matlabclient(1, str')
@@ -142,20 +142,20 @@ matlabclient(1, str')
%fwrite(lcd, str)
%% Radera Displayen
-DC1 = 17;
-ESC = 27;
-Code = 'DL';
-
-% Save the 'small package' as a string
-data = [ESC, double(Code)];
-len = length(data);
-initStr = [DC1, len, data];
-bcc = mod(sum(initStr), 256);
-str = [initStr, bcc];
-
-% Skriv
-matlabclient(1, str')
-%fwrite(lcd, str)
+% DC1 = 17;
+% ESC = 27;
+% Code = 'DL';
+%
+% % Save the 'small package' as a string
+% data = [ESC, double(Code)];
+% len = length(data);
+% initStr = [DC1, len, data];
+% bcc = mod(sum(initStr), 256);
+% str = [initStr, bcc];
+%
+% % Skriv
+% matlabclient(1, str')
+% %fwrite(lcd, str)
%% Avsluta kommunikation med display
-matlabclient(3); \ No newline at end of file
+matlabclient(3);