// FULL RGB rainbow 6DIGs MSD highpreformance projectionclock for running rainmbows //hardwarepictures http://marderchen.de/NEU/HIGH-preformance_88x0603-RGB_rainbowclock_progress.jpg http://marderchen.de/NEU/HIGH-prefrmance_88x0603-RGB_rainbowclock_wiering.jpg http://marderchen.de/NEU/HIGH-prefrmance_88x0603-RGB_rainbowclock_protectionglossy.jpg waa somuch work //the wtf?! superbright SMD (lol so little3 cute purr the 0603 SMD RGB 4pin led size 1x0.8mm (including soldering vontacts, but extrem bright (looks like more then WS2812 with enough heatsink) on this little size its bright enough for adding lense befor and making projection <- this is how LED beamer should work! and not just build in 3 powerfull ledlightsources (one eache color and still shining through a extremly light stealing LCD by heating up^^) //used 88 pcs, 2 each dik balky, foledet with laquecooperwire to digmatrix, (its my self thinked matrix so not like standart) powwered by PNP and NPN transistors SWT ->200R-> (S8030 led and DB140 ->N4007 ->LED) ->5V(+,-) //nut running now! still searching ideas for realising of colorfun can be show and better brightenessystem hihi //MEOW =^.^= #define B1 PC13 #define B2 PC14 #define B3 PC15 #define B4 PA0 #define B6 PA1 #define B6 PA2 #define B7 PA3 #define B8 PA4 #define mess1 PA5 #define t1 PA15 #define t2 PA12 #define rot0 PA6 #define grun0 PA7 #define blau0 PB0 #define rot1 PB1 #define grun1 PB10 #define blau1 PB11 #define rot2 PB12 #define grun2 PB13 #define blau2 PB14 #define rot3 PB15 #define grun3 PA8 #define blau3 PA9 #define rot4 PA10 #define grun4 PB5 #define blau4 PB6 #define rot5 PB7 #define grun5 PB8 #define blau5 PB9 int16_t digitise[6][8][6]; //last: color, brighteness, (autocalculatet: redduty,greenduty,blueduty, whitadder, darkadder) long maintime=millis(); long maintime2=micros(); void setup() { pinMode(rot0, OUTPUT); pinMode(grun0, OUTPUT); pinMode(blau0, OUTPUT); pinMode(rot1, OUTPUT); pinMode(grun1, OUTPUT); pinMode(blau1, OUTPUT); pinMode(rot2, OUTPUT); pinMode(grun2, OUTPUT); pinMode(blau2, OUTPUT); pinMode(rot3, OUTPUT); pinMode(grun3, OUTPUT); pinMode(blau3, OUTPUT); pinMode(rot4, OUTPUT); pinMode(grun4, OUTPUT); pinMode(blau4, OUTPUT); pinMode(rot5, OUTPUT); pinMode(grun5, OUTPUT); pinMode(blau5, OUTPUT); pinMode(B1, OUTPUT); pinMode(B2, OUTPUT); pinMode(B3, OUTPUT); pinMode(B4, OUTPUT); pinMode(B5, OUTPUT); pinMode(B6, OUTPUT); pinMode(B7, OUTPUT); pinMode(B8, OUTPUT); pinMode(t1, INPUT); pinMode(t2, INPUT); } void loop() { zeitreise(); rainbowcalc(); machlicht(); wuseldieabwechslung(); } long maintime3=millis(); void zeitreise(void){ while ((millis()- maintime) >= 5) { for( int dirun = 0; dirun < 0; dirun ++) {} maintime = millis(); } while ((micros()- maintime2) >= 350) { maintime2 = micros(); } while ((millis()- maintime3) >= 1000) { maintime3 = millis(); } } int duty[3]; int rainbow void rainbowcalc(void) { for( int zahli = 0; zahli < 6; zahli ++) { for( int balki = 0; balki < 8; balki ++) { rainbow=digitise[zahli][balki][0]; if(rainbow >=0 && rainbow <=100) {duty[0] =100; duty[1] =rainbow; duty[2] =0;} //rot ->gelb (rotmax grün+ blau0) if(rainbow >=101 && rainbow <=201) {duty[0] =(100 -(rainbow -101)); duty[1] =100; duty[2] =0;} //gelb ->grün (rot- grünmax blau0) if(rainbow >=202 && rainbow <=302) {duty[0] =0; duty[1] =100; duty[2] =(rainbow - 202);} //grün ->cyan (rot0 grünmax blau+) if(rainbow >=303 && rainbow <=403) {duty[0] =0; duty[1] =(100 -(rainbow - 303)); duty[2] =100;} //cyan ->blau (rot0 grün- blaumax) if(rainbow >=404 && rainbow <=504) {duty[0] =(rainbow-404); duty[1] =0; duty[2] =100;} //blau ->lila (rot+ grün0 blaumax) if(rainbow >=505 && rainbow <=605) {duty[0] =100; duty[1] =0; duty[2] =(100- (rainbow -506));} //lila ->rot (rotmax grün0 blau-) if(rainbow >= 606) {rainbow =0; ledata[dirg][5]=0;} digitise[zahli][balki][2]=duty[0]; digitise[zahli][balki][3]=duty[1]; digitise[zahli][balki][4]=duty[2]; }}} /*thingy showing balky in dig "PLAN" dots between are 8 in dig 6(if starting with1 and not 0) first dig from left.. * hihi i know there mus be a better solution better not count the if (s).. * if there is a other solution where i can duty for the 18 colorchanels simultan(sametime) required for fastenough for dutynumberfading.. just flickering if powering one by one.. let me know maybe i get serius and start lerning proffesional coding * its marden code, its fun wruiting kote, its working and good enough to realize my ideas and there is realy no time to learn professional.. MEOW have cute chaosmind.. maybe its better having ideas, and try them anyway to build/get them running.. * than having years of microcontroler experience, studied proffesional coding something like informatic, .. but having no or just somteimes a little idea (hihi i have just more projects and ideas than can realize) in the job and not hobby to write codes.. writing proffesionalcode = job = money =>no needing to find (cheap strange)solution caused can buy solution^^ oh it hing if codes full of monoton stuffiness the writdown thinky making not realy fun, so less tryings ? nevermind MEW =^.^= * * * ---1-- * | | * 3 2 []8 * | | * ---4--- * | | * 5 6 []8 * | | * ---7--- */ void zeigzeugs(int welchezahl, char wasden) { if (wasden == "S") {wasden="5";} if (wasden == "e") {wasden="9";} if (wasden == "R") {wasden="A";} if (wasden == "0") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} if (wasden == "1") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "2") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} if (wasden == "3") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "4") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "5") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "6") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "7") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "8") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "9") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == " ") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=0; } if (wasden == "A") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "L") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} if (wasden == "t") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} if (wasden == "i") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=0; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "m") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "H") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=0; } if (wasden == "o") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=0; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "U") {digitise[welchezahl][1][1]=0; digitise[welchezahl][1][2]=200; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=200; digitise[welchezahl][1][7]=200;} if (wasden == "E") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=200; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} if (wasden == "C") {digitise[welchezahl][1][1]=200; digitise[welchezahl][1][2]=0; digitise[welchezahl][1][3]=200; digitise[welchezahl][1][4]=0; digitise[welchezahl][1][5]=200; digitise[welchezahl][1][6]=0; digitise[welchezahl][1][7]=200;} //see how simple it is brain :3 } long startriger=micros(); int32_t light,darkness,dcach; //1//3//4 void machlicht(void) { for( int dien = 0; dien < ledmeng; dien ++) { if (digitise[zahli][balki][1] > 100){digitise[zahli][balki][4]=digitise[zahli][balki][5]-100; digitise[zahli][balki][6]=0;}//white 200 white 100color working on brightenes but rainbow running if (digitise[zahli][balki][1] <=100){digitise[zahli][balki][4]=(100-(digitise[zahli][balki][6])); digitise[zahli][balki][5]=0;}//dark 100 color, 0less // ledata[dien][11]=(ledata[dien][12]*ledata[dien][12])/1.4; while ((micros()-startriger) >= 2) { for (int8_t balky=1; balky <8; balky++) { if (balky ==1) {digitalWrite(B1, LOW );} if (balky ==2) {digitalWrite(B2, LOW );} if (balky ==3) {digitalWrite(B3, LOW );} if (balky ==4) {digitalWrite(B4, LOW );} if (balky ==5) {digitalWrite(B5, LOW );} if (balky ==6) {digitalWrite(B6, LOW );} if (balky ==7) {digitalWrite(B7, LOW );} if (balky ==8) {digitalWrite(B8, LOW );} // for (int16_t fcount1=0; fcount1 <(100+digitise[zahli][0][5] + digitise[zahli][0][6]); fcount1++) { for (int16_t fcount1=0; fcount1 <200; fcount1++) { if (fcount1 == ((101+digitise[0][balky][5] )-digitise[0][balky][2] )) { digitalWrite(rot0, HIGH );} if (fcount1 == ((101+digitise[0][balky][5] )-digitise[0][balky][3] )) { digitalWrite(grun0, HIGH );} if (fcount1 == ((101+digitise[0][balky][5] )-digitise[0][balky][4] )) { digitalWrite(blau0, HIGH );} if (fcount1 == ((101+digitise[1][balky][5] )-digitise[1][balky][2] )) { digitalWrite(rot1, HIGH );} if (fcount1 == ((101+digitise[1][balky][5] )-digitise[1][balky][3] )) { digitalWrite(grun1, HIGH );} if (fcount1 == ((101+digitise[1][balky][5] )-digitise[1][balky][4] )) { digitalWrite(blau1, HIGH );} if (fcount1 == ((101+digitise[2][balky][5] )-digitise[2][balky][2] )) { digitalWrite(rot2, HIGH );} if (fcount1 == ((101+digitise[2][balky][5] )-digitise[2][balky][3] )) { digitalWrite(grun2, HIGH );} if (fcount1 == ((101+digitise[2][balky][5] )-digitise[2][balky][4] )) { digitalWrite(blau2, HIGH );} if (fcount1 == ((101+digitise[3][balky][5] )-digitise[3][balky][2] )) { digitalWrite(rot3, HIGH );} if (fcount1 == ((101+digitise[3][balky][5] )-digitise[3][balky][3] )) { digitalWrite(grun3, HIGH );} if (fcount1 == ((101+digitise[3][balky][5] )-digitise[3][balky][4] )) { digitalWrite(blau3, HIGH );} if (fcount1 == ((101+digitise[4][balky][5] )-digitise[4][balky][2] )) { digitalWrite(rot4, HIGH );} if (fcount1 == ((101+digitise[4][balky][5] )-digitise[4][balky][3] )) { digitalWrite(grun4, HIGH );} if (fcount1 == ((101+digitise[4][balky][5] )-digitise[4][balky][4] )) { digitalWrite(blau4, HIGH );} if (fcount1 == ((101+digitise[5][balky][5] )-digitise[5][balky][2] )) { digitalWrite(rot5, HIGH );} if (fcount1 == ((101+digitise[5][balky][5] )-digitise[5][balky][3] )) { digitalWrite(grun5, HIGH );} if (fcount1 == ((101+digitise[5][balky][5] )-digitise[5][balky][4] )) { digitalWrite(blau5, HIGH );} if (fcount1 == ((101+digitise[6][balky][5] )-digitise[6][balky][2] )) { digitalWrite(rot6, HIGH );} if (fcount1 == ((101+digitise[6][balky][5] )-digitise[6][balky][3] )) { digitalWrite(grun6, HIGH );} if (fcount1 == ((101+digitise[6][balky][5] )-digitise[6][balky][4] )) { digitalWrite(blau6, HIGH );} if (fcount1 >= (102 + digitise[0][balky][5] + digitise[0][balky][6] ) ) { digitalWrite(rot0, LOW ); digitalWrite(grun0, LOW ); digitalWrite(blau0, LOW );} if (fcount1 >= (102 + digitise[1][balky][5] + digitise[1][balky][6] ) ) { digitalWrite(rot1, LOW ); digitalWrite(grun1, LOW ); digitalWrite(blau1, LOW );} if (fcount1 >= (102 + digitise[2][balky][5] + digitise[2][balky][6] ) ) { digitalWrite(rot2, LOW ); digitalWrite(grun2, LOW ); digitalWrite(blau2, LOW );} if (fcount1 >= (102 + digitise[3][balky][5] + digitise[3][balky][6] ) ) { digitalWrite(rot3, LOW ); digitalWrite(grun3, LOW ); digitalWrite(blau3, LOW );} if (fcount1 >= (102 + digitise[4][balky][5] + digitise[4][balky][6] ) ) { digitalWrite(rot4, LOW ); digitalWrite(grun4, LOW ); digitalWrite(blau4, LOW );} if (fcount1 >= (102 + digitise[5][balky][5] + digitise[5][balky][6] ) ) { digitalWrite(rot5, LOW ); digitalWrite(grun5, LOW ); digitalWrite(blau5, LOW );} if (fcount1 >= (102 + digitise[6][balky][5] + digitise[6][balky][6] ) ) { digitalWrite(rot6, LOW ); digitalWrite(grun6, LOW ); digitalWrite(blau6, LOW );}} if (balky ==1) {digitalWrite(B1, HIGH );} if (balky ==2) {digitalWrite(B2, HIGH );} if (balky ==3) {digitalWrite(B3, HIGH );} if (balky ==4) {digitalWrite(B4, HIGH );} if (balky ==5) {digitalWrite(B5, HIGH );} if (balky ==6) {digitalWrite(B6, HIGH );} if (balky ==7) {digitalWrite(B7, HIGH );} if (balky ==8) {digitalWrite(B8, HIGH );} } startriger = micros(); } } //*its marten code so never verry efficient or often used standart variablenames for me just codwriting musst be kind of fun not monotonous thingi.. but stil working fine =^.^=* //its cheaper to buy 4pin none chip RGB leds than WS2812B ever its more solderin work but less powerconsumtion and more brightenes, differen shapes,.....