From 14316190c54d02fd109dcb77392399902ba3ec2d Mon Sep 17 00:00:00 2001 From: Florian Zahn Date: Wed, 6 Nov 2019 19:18:16 +0100 Subject: [PATCH] First work on project --- gedoens-excel.xlsx | Bin 0 -> 9927 bytes sketch_nov03b.ino | 126 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 gedoens-excel.xlsx create mode 100644 sketch_nov03b.ino diff --git a/gedoens-excel.xlsx b/gedoens-excel.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8300692dc0efb7e0c77c3a6f1eb5105242556271 GIT binary patch literal 9927 zcmeHNgy0st}q6#xK$047J7R)%l@KrA8vfDb^0*AsVi za5Z;uHB$F-GIud}?rCpF@c|K@E(ZV)oBzM|U%Ue434@9dR-Bht(zoIp%(9EMBB-2) zL49}(DncFI@x7&{dRf-i4_OgEaKv&6ZMbXjMi+h9Plv5)9qc~^h4(hAV!R9N@6a#= za422ipCPIo5^JKe<)l`GL_z`Une%;`xGTMl z7^S+!y!{KEtBRV-xIAA3s~()|q7x-%UOy0A;_fz`b%@~%bbzRR!wy&bclmt| zzHaITADt%c`m^670{{;X2ms~3h-JM7E7duS*W_VRhYk}Z z)2o+*6_g;X7@^0~w_*KPQ%kWpVsaj$(#;@szW|vC6uH59UcKc)hCaN(BzxfZYT`ToRcJ9m#=l>x=&q9U8YLOdeOPJ#xRsM z6z9qftWZf#oJ!Q-j6T;QMZ+&33ndav4b<&b&{;OQu7sNsQ#-5(t^UlNvll;_?mv@M zxQi(q&MSW~o=Vv7Vq!U0`KI3vbn%^3L(PiUy4obmnUB)T$jq+eOd`D<|LzU5Vn)9z zB?sO$`>0eOP0oeCZXL(zV5V0$HyWg@|70NO9eMFG%tHNLNCJftlFwi((gYI{QUEHP zrya}ha^m6WY-{4^X#3N8{aa?>U?vPk<-fa?t18HKv*NU(--oe!q`MR1&bhKs9%$@i zqYl*3FFXUi@H<}tGBg=zPs_0&IEH#15BIrWabiIc@Gm+UizD$6z47g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k#+ORp_(mP6pQ8DOOlf#< z5yY>T7CmrQ1d&{it9k7`)-G$VbeRU6GGF9zvgIqQU844SKPnk$dy2_Nvuz*A``Ich zuONOTF{8-Fwqq?#YKK%`jAjLW56)P71=&ts_o8lZOgUVqw%s#uhH^o?3$7eTPy#*c zv6EFgn9bebL-8^6DRV)q&v%8lDl$iD32YhUDSek84c}vu>2qNr<71*HXB5zc?Mk%< zN8jCt=)QY%Z$;!W_|O`+v{V$@aApH$29P9wq83-YyR%R!@)Dd z()Is*Wa!`f_wVr^4iG8J{guF94>$Z9_;XB#3CW+1I{XU!Yr*%=z!q3c@&A{9f2H$l z74Q#A$FNgTztjYO1^-&Z_yg>K@f-MW6^&mh{F;CNgTgs19{{`kui5xt3H+Kt_=A88 z;qQ;|pM1iv&|d?vKcJ4VcC ZFAb?IhXmVQ0N@eq69D5$HtL_>{traQqJsbc literal 0 HcmV?d00001 diff --git a/sketch_nov03b.ino b/sketch_nov03b.ino new file mode 100644 index 0000000..02f61e6 --- /dev/null +++ b/sketch_nov03b.ino @@ -0,0 +1,126 @@ +#define LOAD 10 +#define DATA 8 +#define CLOCK 9 + +#define MAX_WIDTH 32 +#define MAX_HEIGHT 40 + +typedef struct image_t { + int width; + int height; + byte data[MAX_WIDTH * MAX_HEIGHT]; +}; + +image_t img; + +byte get_pixel(image_t* p, int x, int y) { + return p->data[y*p->width + x]; +} + +byte set_pixel(image_t* p, int x, int y, byte value) { + p->data[y*p->width + x] = value; +} + +void setup() { + Serial.begin(115200); + + img.width = 32; + img.height = 40; + + // put your setup code here, to run once: + byte pixel = 1; + for(int y = 0; y < img.height; y++) { + pixel = y % 2; + for(int x = 0; x < img.width; x++) { + set_pixel(&img, x, y, pixel); + pixel = !pixel; + } + } + + pinMode(DATA,OUTPUT); + pinMode(CLOCK,OUTPUT); + pinMode(LOAD,OUTPUT); +} + +void send_block(image_t* p, int x, int y) { + int order[32][2] = { + { 6, 2 }, // 32 + { 7, 2 }, // 31 + { 6, 3 }, // 30 + { 5, 2 }, // 29 + { 5, 3 }, // 28 + { 4, 2 }, // 27 + { 7, 3 }, // 26 + { 4, 3 }, // 25 + { 3, 3 }, // 24 + { 3, 2 }, // 23 + { 2, 3 }, // 22 + { 0, 2 }, // 21 + { 2, 2 }, // 20 + { 1, 3 }, // 19 + { 1, 2 }, // 18 + { 0, 3 }, // 17 + { 0, 0 }, // 16 + { 1, 1 }, // 15 + { 0, 1 }, // 14 + { 1, 0 }, // 13 + { 2, 1 }, // 12 + { 2, 0 }, // 11 + { 3, 0 }, // 10 + { 3, 1 }, // 9 + { 4, 0 }, // 8 + { 7, 1 }, // 7 + { 7, 0 }, // 6 + { 4, 1 }, // 5 + { 5, 0 }, // 4 + { 6, 1 }, // 3 + { 6, 0 }, // 2 + { 5, 1 } // 1 + }; + + Serial.println("start block"); + for(int n = 0; n < 32; n++) { + int x_offset = order[n][1]; + int y_offset = order[n][0]; + + byte pixel = get_pixel(p, x + x_offset, y + y_offset); + Serial.print("x="); + Serial.print(x_offset); + Serial.print(" y="); + Serial.print(y_offset); + Serial.print(" pixel="); + Serial.println(pixel); + + + digitalWrite(DATA, pixel); + clock(); + } + + // 33 bit - kein pixel - senden + clock(); +} + +void clock() { + digitalWrite(CLOCK,HIGH); + digitalWrite(CLOCK,LOW); +} + +void load() { + digitalWrite(LOAD,HIGH); + digitalWrite(LOAD,LOW); +} + +void loop() { + digitalWrite(DATA, LOW); + for(int i = 0; i < 1320; i++) { + clock(); + } + + for(int y = 0; y < img.height; y+=8) { + for(int x = 0; x < img.width; x+=4) { + send_block(&img, x, y); + } + } + + load(); +}