//its for duty driving 16channel (used DB237 NPN 2A each channel) for powerserverturbine table ventilator with 8 12V 1-1.4A dualrotordurbines.. //hiihi cute smal is turbine dimensions 40x40x56mm and power of 8 regulatet by STM 0-150Watt (kind of loud awesome powerfull noising) //maybe using temp for automation later.. //pics https://marderchen.lima-city.de/NEU+/byebye_hotholeair.jpg https://marderchen.lima-city.de/NEU+/upto_150Watt_tableventilator_16_regulatet_12V2A_fanchannels_testrun.jpg https://marderchen.lima-city.de/NEU+/upto_150Watt_tableventilator_progress.jpg https://marderchen.lima-city.de/NEU+/16_turbofans_STMcontroler.jpg // https://marderchen.lima-city.de/NEU+/zort_all36_PNPtransistorsblownuo_currenttohigh.jpg zort first NPN S80501.4A battery blown up by tryind pulsingcharge capacitors.... also take STM board i9nto nirvana.. //used capacitors finaly: 16V/100yF (each channel) 470R + ultrabright green for front rotor, same with orange LED for back rotor.. // https://marderchen.lima-city.de/NEU+/why_becoke_evilbad_allrealyknown_dechavuefelingsfromit.jpg https://marderchen.lima-city.de/NEU+/martwnjole_coolimgsteam_progress.jpg https://marderchen.lima-city.de/NEU+/DELL_serverfanplug_pinout.jpg oh its working fina now.. planed to buy more turbines caused cute noise realy acetpable is not full power //have fun use it like you want if usefull .. better not with ATX wires getrting hot if eating >10A on one plug.. wtf? chueap crappy capitalism //[MEOW] summer comming tofast #include #include #include const byte chips = 1; // 1 chip, bit banged SPI on pins 6, 7, 8 MAX7219 display (chips, PA4, PA7, PA5); // Chips / LOAD / DIN / CLK String outzi = "Purrrrrr "; #define rot PB0 #define blau PA3 #define fan1_a PC13 #define fan1_b PC14 #define fan2_a PC15 #define fan2_b PA0 #define fan3_a PB1 #define fan3_b PB10 #define fan4_a PB11 #define fan4_b PB12 #define fan5_a PB13 #define fan5_b PB14 #define fan6_a PB15 #define fan6_b PB5 #define fan7_a PB6 #define fan7_b PB7 #define fan8_a PB8 #define fan8_b PB9 #define t1 PA8 #define t2 PA9 #define t3 PA10 #define t4 PA12 #define t5 PA15 #define temp1 PA1 #define temp2 PA2 uint8_t onpress[15]; int progy=0; int zeit1; boolean tplusset=false; boolean tminusset=false; void setup() { delay(1000); pinMode(rot, OUTPUT); pinMode(blau, OUTPUT); pinMode(fan1_a, OUTPUT); pinMode(fan1_b, OUTPUT); pinMode(fan5_a, OUTPUT); pinMode(fan5_b, OUTPUT); pinMode(fan2_a, OUTPUT); pinMode(fan2_b, OUTPUT); pinMode(fan6_a, OUTPUT); pinMode(fan6_b, OUTPUT); pinMode(fan3_a, OUTPUT); pinMode(fan3_b, OUTPUT); pinMode(fan7_a, OUTPUT); pinMode(fan7_b, OUTPUT); pinMode(fan4_a, OUTPUT); pinMode(fan4_b, OUTPUT); pinMode(fan8_a, OUTPUT); pinMode(fan8_b, OUTPUT); pinMode(t1, INPUT); pinMode(t2, INPUT); pinMode(t3 ,INPUT); pinMode(t4 ,INPUT); pinMode(t5 ,INPUT); delay(300); display.begin (); delay(100); undlos("boot"); delay(300); } uint16_t maxturb=2000; uint16_t adder=10; uint16_t tube1_a,tube1_b, tube2_a,tube2_b, tube3_a,tube3_b, tube4_a,tube4_b; uint16_t tube5_a,tube5_b, tube6_a,tube6_b, tube7_a,tube7_b, tube8_a,tube8_b; uint16_t Tasol=50; uint16_t Tbsol=50; uint16_t T_sol=50; uint16_t tempy1,tempy2; void loop() { zeitreise(); lesesensibel(); } void laufprogrammlauf(void){ if (progy == 0) {undlos("ready"); } if (progy == 1) {zeigwort("T_1a",1); zeigzahl(tube1_a,2); if (tplusset ==true) {tplusset=false; if (tube1_a adder) { tube1_a-=adder;}}} if (progy == 2) {zeigwort("T_1b",1); zeigzahl(tube1_b,2); if (tplusset ==true) {tplusset=false; if (tube1_b adder) { tube1_b-=adder;}}} if (progy == 3) {zeigwort("T_2a",1); zeigzahl(tube2_a,2); if (tplusset ==true) {tplusset=false; if (tube2_a adder) { tube2_a-=adder;}}} if (progy == 4) {zeigwort("T_2b",1); zeigzahl(tube2_b,2); if (tplusset ==true) {tplusset=false; if (tube2_b adder) { tube2_b-=adder;}}} if (progy == 5) {zeigwort("T_3a",1); zeigzahl(tube3_a,2); if (tplusset ==true) {tplusset=false; if (tube3_a adder) { tube3_a-=adder;}}} if (progy == 6) {zeigwort("T_3b",1); zeigzahl(tube3_b,2); if (tplusset ==true) {tplusset=false; if (tube3_b adder) { tube3_b-=adder;}}} if (progy == 7) {zeigwort("T_4a",1); zeigzahl(tube4_a,2); if (tplusset ==true) {tplusset=false; if (tube4_a adder) { tube4_a-=adder;}}} if (progy == 8) {zeigwort("T_4b",1); zeigzahl(tube4_b,2); if (tplusset ==true) {tplusset=false; if (tube4_b adder) { tube4_b-=adder;}}} if (progy == 9) {zeigwort("T_5a",1); zeigzahl(tube5_a,2); if (tplusset ==true) {tplusset=false; if (tube5_a adder) { tube5_a-=adder;}}} if (progy == 10) {zeigwort("T_5b",1); zeigzahl(tube5_b,2); if (tplusset ==true) {tplusset=false; if (tube5_b adder) { tube5_b-=adder;}}} if (progy == 11) {zeigwort("T_6a",1); zeigzahl(tube6_a,2); if (tplusset ==true) {tplusset=false; if (tube6_a adder) { tube6_a-=adder;}}} if (progy == 12) {zeigwort("T_6b",1); zeigzahl(tube6_b,2); if (tplusset ==true) {tplusset=false; if (tube6_b adder) { tube6_b-=adder;}}} if (progy == 13) {zeigwort("T_7a",1); zeigzahl(tube7_a,2); if (tplusset ==true) {tplusset=false; if (tube7_a adder) { tube7_a-=adder;}}} if (progy == 14) {zeigwort("T_7b",1); zeigzahl(tube7_b,2); if (tplusset ==true) {tplusset=false; if (tube7_b adder) { tube7_b-=adder;}}} if (progy == 15) {zeigwort("T_8a",1); zeigzahl(tube8_a,2); if (tplusset ==true) {tplusset=false; if (tube8_a adder) { tube8_a-=adder;}}} if (progy == 16) {zeigwort("T_8b",1); zeigzahl(tube8_b,2); if (tplusset ==true) {tplusset=false; if (tube8_b adder) { tube8_b-=adder;}}} if (progy == 17) {zeigwort("AL_a",1); zeigzahl(Tasol,2); if (tplusset ==true) {tplusset=false; if (Tasol adder) { Tasol-=adder;}}setviele(Tasol,1);} if (progy == 18) {zeigwort("AL_b",1); zeigzahl(Tbsol,2); if (tplusset ==true) {tplusset=false; if (Tbsol adder) { Tbsol-=adder;}}setviele(Tbsol,2);} if (progy == 19) {zeigwort("ALL_",1); zeigzahl(T_sol,2); if (tplusset ==true) {tplusset=false; if (T_sol adder) { T_sol-=adder;}}setviele(T_sol,1); setviele(T_sol,2);} if (progy == 20) {zeigzahl(tempy1,1); zeigzahl(tempy2,2);} if (progy >= 21) {progy=0;} } void setviele(uint16_t wieviel,uint8_t wooo){ if (wooo==1){tube1_a=wieviel; tube2_a=wieviel; tube3_a=wieviel; tube4_a=wieviel; tube5_a=wieviel; tube6_a=wieviel; tube7_a=wieviel; tube8_a=wieviel; } //ups better uasing array for values... if (wooo==2){tube1_b=wieviel; tube2_b=wieviel; tube3_b=wieviel; tube4_b=wieviel; tube5_b=wieviel; tube6_b=wieviel; tube7_b=wieviel; tube8_b=wieviel; } } void lesesensibel(){ if ((analogRead(temp1)/5) >= tempy1) { tempy1++;} if ((analogRead(temp1)/5) < tempy1) { tempy1--;} if ((analogRead(temp2)/5) >= tempy2) { tempy2++;} if ((analogRead(temp2)/5) < tempy2) { tempy2--;} } void istinput(void){ if (zeit1 >=1) { if (digitalRead(t1) == HIGH && onpress[0] ==0) { onpress[0] =1;tplusset=true; } if (onpress[0] == 1) { onpress[1]++;} if (onpress[1] >= 3) { onpress[1] =0; onpress[0]=0; } if (digitalRead(t2) == HIGH && onpress[2] ==0) { onpress[2] =1; progy++; } if (onpress[2] == 1) { onpress[3]++;} if (onpress[3] >= 40) { onpress[3] =0; onpress[2]=0; } if (digitalRead(t3) == HIGH && onpress[4] ==0) { onpress[4] =1; } if (onpress[4] == 1) { onpress[5]++;} if (onpress[5] >= 10) { onpress[5] =0; onpress[4]=0; } if (digitalRead(t4) == HIGH && onpress[6] ==0) { onpress[6] =1; progy--; } if (onpress[6] == 1) { onpress[7]++;} if (onpress[7] >= 40) { onpress[7] =0; onpress[6]=0; } if (digitalRead(t5) == HIGH && onpress[8] ==0) { onpress[8] =1; tminusset=true;} if (onpress[8] == 1) { onpress[9]++;}if (onpress[9] >= 5) { onpress[9] =0; onpress[8]=0; } zeit1=0; laufprogrammlauf(); }} long maintime=millis(); long maintime2=millis(); long maintime3=millis(); long timez=millis(); long flash=micros(); void zeitreise(void){ while ((millis()- maintime) >= 5){zeit1++;istinput(); maintime = millis();} while ((millis()- maintime3) >= 200) { maintime3 = millis();} while ((millis()- maintime2) >= 20) { maintime2 = millis();} while ((millis()- timez) >= 999) {timez = millis(); } while ((micros()-flash) >= 3) {schaltzeugs();flash = micros();} } void schaltzeugs(void) { for (uint16_t zahl=0; zahl <2001; zahl++) { if (zahl ==0){turbinenaus();} if (zahl >=1 &&zahl <=1999){ if (zahl == (2000-tube1_a)) { digitalWrite(fan1_a, HIGH );} if (zahl == (2000-tube1_b)) { digitalWrite(fan1_b, HIGH );} if (zahl == (2000-tube2_a)) { digitalWrite(fan2_a, HIGH );} if (zahl == (2000-tube2_b)) { digitalWrite(fan2_b, HIGH );} if (zahl == (2000-tube3_a)) { digitalWrite(fan3_a, HIGH );} if (zahl == (2000-tube3_b)) { digitalWrite(fan3_b, HIGH );} if (zahl == (2000-tube4_a)) { digitalWrite(fan4_a, HIGH );} if (zahl == (2000-tube4_b)) { digitalWrite(fan4_b, HIGH );} if (zahl == (2000-tube5_a)) { digitalWrite(fan5_a, HIGH );} if (zahl == (2000-tube5_b)) { digitalWrite(fan5_b, HIGH );} if (zahl == (2000-tube6_a)) { digitalWrite(fan6_a, HIGH );} if (zahl == (2000-tube6_b)) { digitalWrite(fan6_b, HIGH );} if (zahl == (2000-tube7_a)) { digitalWrite(fan7_a, HIGH );} if (zahl == (2000-tube7_b)) { digitalWrite(fan7_b, HIGH );} if (zahl == (2000-tube8_a)) { digitalWrite(fan8_a, HIGH );} if (zahl == (2000-tube8_b)) { digitalWrite(fan8_b, HIGH );}} if (zahl >= 2000) { turbinenaus();}} } void turbinenaus(void){ digitalWrite(fan1_a,LOW);digitalWrite(fan1_b,LOW);digitalWrite(fan2_a,LOW);digitalWrite(fan2_b,LOW); digitalWrite(fan3_a,LOW);digitalWrite(fan3_b,LOW);digitalWrite(fan4_a,LOW);digitalWrite(fan4_b,LOW); digitalWrite(fan5_a,LOW);digitalWrite(fan5_b,LOW);digitalWrite(fan6_a,LOW);digitalWrite(fan6_b,LOW); digitalWrite(fan7_a,LOW);digitalWrite(fan7_b,LOW);digitalWrite(fan8_a,LOW);digitalWrite(fan8_b,LOW);} void zeigzahl(int zahlz,int daa) { outzi=""; if(zahlz <=9) {outzi+="0";} if(zahlz <=99) {outzi+="0";} if(zahlz <=999) {outzi+="0";} outzi+=String(zahlz); if (daa ==1) {for (byte ixx = 0; ixx < 4; ixx++){display.sendChar (ixx, outzi[ixx]);}} if (daa ==2) {for (byte ix2 = 0; ix2 < 4; ix2++){display.sendChar (ix2+4, outzi[ix2]);}} if (daa ==3) {for (byte ix3 = 0; ix3 < 4; ix3++){display.sendChar (ix3+8, outzi[ix3]);}} if (daa ==4) {for (byte ix4 = 0; ix4 < 4; ix4++){display.sendChar (ix4+12, outzi[ix4]);}} zahlz=0; } void zeigwort(String woortz,int hier) { if (hier == 1){for (int iqq = 0; iqq < 4; iqq++){display.sendChar (iqq, woortz[iqq]);}} if (hier == 2){for (int iq2 = 0; iq2 < 4; iq2++){display.sendChar (iq2+4, woortz[iq2]);}} if (hier == 3){for (int iq3 = 0; iq3 < 4; iq3++){display.sendChar (iq3+8, woortz[iq3]);}} if (hier == 4){for (int iq4 = 0; iq4 < 4; iq4++){display.sendChar (iq4+12, woortz[iq4]);}} woortz=""; } void undlos(String meows) { // for print string to MAX 8dig display for (int i = 0; i < 8; i++){ display.sendChar (i, meows[i]); } }