//tfirst oled 2k2V 105uF charger killed 3* stm32f103c8t6 9U boards 2k2V jumping anywhere.. so build new with ili9341 2.8C lcd color touchscreen(touch not used) and 93 board caused need last 9U board left for WS2812B projects //board STM32F103C8T6 minimum system board + tft: ILI9341 (240x320pixel 2,8" COLOR touchscreen LCD SPI1) +using Adafruit library with STM-master on Arduino IDE //supply 6x 18650 2.4Ah >> 14.4Ah total (3x tp4056 charger paralel, microusb ports) >>6A miniswitch >9900uF 10V > 4A boost stepup (seted to 12VDC< 25V 3300uF<)+ boost stepup (5V2A)>3300uF 10V > AMS1117 3V3 3300uF 10V //pins TFT ::VCC on 3.3V ::LED on 3.3V ::GND on GND :: CS on PB1 :: Reset on PB0 :: DC/RS on PA4 :: SCK on A5 :: MISO on A6 :: MOSI on A7 <150R red(+5V >2A100V diode>led, 10V 33 uF tantal Parralel to LED) #define grun PC14 //GPIO>150R gren(+5V >1A100V diode>led, 10V 33 uF tantal Parralel to LED) #define blau PC15 //GPIO>150R blue(+5V led, 10V 33 uF tantal Parralel to LED) //0603 singlecolors #define cgrun PB12 //emeralt #define crot PB5 #define cweis PB6 #define cblau PB7 //taster GPIOs 470R grounded, code function i created istinput(); is for anticlipping //7tasters on coverboard, tasterboard from broken lcd tv #define t1 PA15 #define t2 PA10 #define t3 PA9 #define t4 PA8 #define t5 PB15 #define t6 PB14 #define t7 PB13 //measure #define volt PA0 //+max 2200V>(9pcs 10kOhm)+470R+220R+10R+100R+100R+(*1)100R>GND inline *1(1uF capacitor parralel)>>GPIO analog measure used measurevalue*1000 =volt #define temp PA1 //tempsensor(10k) grounding GPIO which is also connectet with 10kR to 3V3 //NPN =D882 3A SMD transistor #define npnled PA2//GPIO>150R UV(+5V, 10V 33 uF tantal Parralel) #define npnF PA3//GPIO>470R fan(+12V, 16V 200uF parrall) //booth mosftes have 6A switch caused not sure which working better original or irf3205 (booth N-channel mosfets) //mosfets pulsing +12V to ferrit 2kV inverter primecoil over 0.05R #define npna PB10 //mos1 GPIO> 470R>>NPN(J3Y)>>220R>>PNP(Y2)(12V)>>irf3205 #define npnb PB11 //mos2 GPIO> 470R>>NPN(J3Y)>>220R>>PNP(Y2)(12V)>>factorym mosfet #define npnP1 PB9//Ropen GPIO> 470R>> relai(+12V) freerunningdiode >(1A100V reversed parralel to relaicoil) #define npnP2 PB8//Rclose GPIO> 470R>> relai(+12V) freerunningdiode >(1A100V reversed parralel to relaicoil) //charger ciruit 2x ? 1000V factore highdrain diode to 2200V105uF capacitor or own rectifier build with 12* 1A 1000V diodes (3inline ever) #define TFT_CS PB1 #define TFT_DC PA4 #define TFT_RST PB0 #define swap(a, b) { int16_t t = a; a = b; b = t; } Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC, TFT_RST); // Use hardware SPI //like cats :3 so a cute OLED bootpicture const unsigned char PROGMEM cat [] = // width 66px height 46 { 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, // ## 0x00, 0x00, 0x0F, 0x0E, 0x18, 0x60, 0x00, 0x00, 0x00, // #### ### ## ## 0x00, 0x00, 0x04, 0x94, 0xF9, 0xE0, 0x00, 0x00, 0x00, // # # # # ##### #### 0x00, 0x00, 0x02, 0x67, 0xB7, 0x40, 0x00, 0x00, 0x00, // # ## #### ## ### # 0x00, 0x3F, 0xFC, 0x22, 0x26, 0x40, 0x00, 0x00, 0x00, // ############ # # # ## # 0x01, 0xE0, 0x04, 0x62, 0x2C, 0x60, 0x00, 0x00, 0x00, // #### # ## # # ## ## 0x07, 0x00, 0x00, 0x02, 0x38, 0x3F, 0xF8, 0x00, 0x00, // ### # ### ########### 0x3C, 0x00, 0x00, 0x02, 0x10, 0x00, 0x0F, 0x80, 0x00, // #### # # ##### 0x60, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, // ## ##### #### 0xDF, 0xE0, 0x7F, 0xE0, 0x01, 0xFE, 0x00, 0x1C, 0x00, // ## ######## ########## ######## ### 0xF0, 0x30, 0xFF, 0xF0, 0x07, 0xFF, 0x00, 0x07, 0x00, // #### ## ############ ########### ### 0x80, 0x18, 0xFF, 0xF0, 0x0F, 0xFF, 0x00, 0x01, 0x80, // # ## ############ ############ ## 0xC0, 0x31, 0xFF, 0xF8, 0x1F, 0xFF, 0x83, 0xFC, 0xC0, // ## ## ############## ############## ######## ## 0x41, 0x19, 0xFF, 0xF8, 0x1F, 0xFF, 0x82, 0x07, 0xC0, // # # ## ############## ############## # ##### 0x61, 0xF1, 0xFF, 0xF8, 0x1F, 0xFF, 0xCE, 0x00, 0x40, // ## ##### ############## ############### ### # 0x20, 0x81, 0xFF, 0xFC, 0x1F, 0xFF, 0xC7, 0xC0, 0x40, // # # ############### ############### ##### # 0x30, 0x71, 0xFF, 0xFC, 0x3F, 0xFF, 0xC0, 0x40, 0xC0, // ## ### ############### ################ # ## 0x10, 0x39, 0x3F, 0xE4, 0x3F, 0xFF, 0xC1, 0x80, 0x80, // # ### # ######### # ################ ## # 0x18, 0x41, 0x00, 0x04, 0x3F, 0xFE, 0x66, 0x00, 0x80, // ## # # # ############# ## ## # 0x0E, 0x01, 0xFF, 0xE4, 0x3F, 0xF0, 0x23, 0x01, 0x80, // ### ############ # ########## # ## ## 0x03, 0x01, 0xC0, 0x3C, 0x20, 0x00, 0x20, 0x03, 0x00, // ## ### #### # # ## 0x01, 0x81, 0x00, 0x08, 0x3F, 0x00, 0x20, 0x02, 0x00, // ## # # ###### # # 0x00, 0x80, 0x00, 0x00, 0x31, 0xFE, 0x60, 0x06, 0x00, // # ## ######## ## ## 0x00, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x0C, 0x00, // ## #### ## 0x00, 0x70, 0x0F, 0xE0, 0x00, 0x00, 0xC0, 0x18, 0x00, // ### ####### ## ## 0x00, 0x1C, 0x38, 0x11, 0xE7, 0xF0, 0x00, 0x30, 0x00, // ### ### # #### ####### ## 0x00, 0x04, 0x60, 0xF1, 0xC3, 0x9C, 0x00, 0x60, 0x00, // # ## #### ### ### ### ## 0x00, 0x0C, 0xC1, 0x80, 0x80, 0xC6, 0x40, 0xC0, 0x00, // ## ## ## # ## ## # ## 0x00, 0x10, 0x83, 0x00, 0x00, 0x60, 0x67, 0x80, 0x00, // # # ## ## ## #### 0x00, 0xE0, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, // ### ## #### 0x01, 0x80, 0x04, 0x00, 0x80, 0x80, 0x30, 0x00, 0x00, // ## # # # ## 0x00, 0xFF, 0x80, 0x20, 0x81, 0xF0, 0x0E, 0x00, 0x00, // ######### # # ##### ### 0x00, 0x18, 0x60, 0x11, 0xC6, 0x18, 0x03, 0xC0, 0x00, // ## ## # ### ## ## #### 0x00, 0x60, 0x00, 0x1F, 0x7C, 0x0C, 0x3C, 0x60, 0x00, // ## ##### ##### ## #### ## 0x00, 0x7F, 0x80, 0x14, 0x28, 0x04, 0x07, 0xC0, 0x00, // ######## # # # # # ##### 0x00, 0x43, 0xF0, 0x18, 0x1E, 0x34, 0x01, 0x00, 0x00, // # ###### ## #### ## # # 0x00, 0x02, 0x1C, 0x00, 0x02, 0x1C, 0x3D, 0x00, 0x00, // # ### # ### #### # 0x00, 0x06, 0x00, 0x00, 0x03, 0x10, 0x67, 0x80, 0x00, // ## ## # ## #### 0x00, 0x01, 0xC0, 0x00, 0x01, 0xB0, 0x34, 0x00, 0x00, // ### ## ## ## # 0x00, 0x00, 0x78, 0x00, 0x00, 0xE7, 0xF8, 0x00, 0x00, // #### ### ######## 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, // ### ### 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // ## # 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // # # 0x00, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, 0x00, 0x00, // ## ## 0x00, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, // # # 0x00, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, // # # }; #define graphsize 128 void setup(){ delay(100); pinMode(rot,OUTPUT);pinMode(grun,OUTPUT);pinMode(blau,OUTPUT);pinMode(cgrun,OUTPUT);pinMode(cweis,OUTPUT);pinMode(crot,OUTPUT);pinMode(cblau,OUTPUT); pinMode(npnled,OUTPUT);pinMode(npnF,OUTPUT);pinMode(npna,OUTPUT);pinMode(npnb,OUTPUT);pinMode(npnP1,OUTPUT);pinMode(npnP2,OUTPUT); pinMode(t1,INPUT);pinMode(t2,INPUT); pinMode(t3,INPUT);pinMode(t4,INPUT);pinMode(t5,INPUT); pinMode(t6,INPUT);pinMode(t7,INPUT); displaystart(); delay(600);} void displaystart(void) {tft.begin(); tft.fillScreen(ILI9341_BLACK); tft.setRotation(1);tft.drawBitmap(30, 10,cat,66, 46, 0xffff); } long maintime=millis();long littletime=micros();long slowtime=micros();long tiktak=millis();long dimmer2=micros();long slowtime2=millis(); uint16_t laag[8]={16,2,14,2,5,2},onpress[18],welch,positor; //0=erster an zeit, 1=bis 2=auszeit, 3=oft bis 2micros,4=soll uint16_t spannung=10,messcach[2][graphsize+1]; boolean tplusset=false,tminusset=false,istan=false;uint8_t auswahlzi=1; void loop(){zeitreise();} void zeitreise(void){ while ((millis()- maintime) >= 8){maintime=millis();istinput();} while ((micros()- slowtime)>200){messmal();slowtime = micros();} while ((millis()- tiktak) >= 30){writegraph();zeigmalher();tiktak=millis();} while ((micros()- littletime) >= 2){pulspowder();littletime = micros();}} void istinput(void){onpress[14]++; if (onpress[14] >=2) {onpress[14]=0; if (digitalRead(t1) == HIGH && onpress[0] ==0 && auswahlzi<8) {onpress[0]=1;auswahlzi++;} if (onpress[0]==1){onpress[1]++;}if(onpress[1]>=20){onpress[1]=0;onpress[0]=0;} if (digitalRead(t2) == HIGH && onpress[2] ==0&& auswahlzi >0) {onpress[2]=1;auswahlzi--;} if (onpress[2]==1){onpress[3]++;}if(onpress[3]>=25){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; if(istan==true){istan=false;}else{istan=true;}} if (onpress[6]==1){onpress[7]++;}if(onpress[7]>=20){onpress[7]=0;onpress[6]=0;} if (digitalRead(t5) == HIGH && onpress[8] ==0) { onpress[8] =1; } if (onpress[8]==1){onpress[9]++;}if(onpress[9]>=10){onpress[9]=0;onpress[8]=0;} if (digitalRead(t6) == HIGH && onpress[10] ==0) { onpress[10] =1; tplusset=true;} if (onpress[10]==1){onpress[11]++;}if(onpress[11]>=10){onpress[11]=0;onpress[10]=0;} if (digitalRead(t7) == HIGH && onpress[12] ==0) { onpress[12] =1; tminusset=true;} if (onpress[12]==1){onpress[13]++;}if(onpress[13]>=10){onpress[13]=0;onpress[12]=0;} if((digitalRead(t1)||digitalRead(t2)||digitalRead(t3)||digitalRead(t4)||digitalRead(t5)||digitalRead(t6)||digitalRead(t7))==HIGH){digitalWrite(cblau,HIGH);}else{digitalWrite(cblau,LOW);} // for(uint8_t spring=0;spring<13;spring+=2){if (onpress[spring]>0){malconfiscreen();}} configdas(); }} uint8_t adder=1; void configdas() { if (auswahlzi==0) {adder=1; if (tplusset ==true && laag[0] <100) {tplusset=false; laag[0]+=adder;} if (tminusset==true && laag[0] >=adder){tminusset=false; laag[0]-=adder;}} if (auswahlzi==1) {adder=1; if (tplusset ==true && laag[1] <100) {tplusset=false; laag[1]+=adder;} if (tminusset==true && laag[1] >=adder){tminusset=false; laag[1]-=adder;}} if (auswahlzi==2) {adder=1; if (tplusset ==true && laag[2] <100) {tplusset=false; laag[2]+=adder;} if (tminusset==true && laag[2] >=adder){tminusset=false; laag[2]-=adder;}} if (auswahlzi==3) {adder=1; if (tplusset ==true && laag[3] <100) {tplusset=false; laag[3]+=adder;} if (tminusset==true && laag[3] >=adder){tminusset=false; laag[3]-=adder;}} if (auswahlzi==4) {adder=1; if (tplusset ==true && laag[4] <100) {tplusset=false; laag[4]+=adder;} if (tminusset==true && laag[4] >=adder){tminusset=false; laag[4]-=adder;}} if (auswahlzi==5) {adder=1; if (tplusset ==true && laag[5] <100) {tplusset=false; laag[5]+=adder;} if (tminusset==true && laag[5] >=adder){tminusset=false; laag[5]-=adder;}} if (auswahlzi==6) {adder=1; if (tplusset ==true && laag[6] <100) {tplusset=false; laag[6]+=adder;} if (tminusset==true && laag[6] >=adder){tminusset=false; laag[6]-=adder;}} if (auswahlzi==7) {} if (auswahlzi==8) {} } void blinkyblinky(void){ if(digitalRead(t7) == HIGH){onpress[15]=20;} if(onpress[15]>0){onpress[15]--;digitalWrite(npnP2,HIGH);}else{digitalWrite(npnP2,LOW);} if(onpress[15]>0 && (onpress[15]%2)==0){digitalWrite(rot,HIGH);}else{digitalWrite(rot,LOW);} onpress[16]++;if(onpress[16]>20){onpress[16]=0;} if((onpress[16]%10)==0 && (laag[5]*100)>=(spannung-20)){digitalWrite(cgrun,HIGH);}else{digitalWrite(cgrun,LOW);} if((onpress[16]%4)==0 && (laag[5]*100)<(spannung-20)){digitalWrite(cweis,HIGH);}else{digitalWrite(cweis,LOW);} } int32_t messdas=5,warm=5,temper; void messmal(void){ messdas=(analogRead(volt)*(0.5))+10; if(spannung > messdas&& messdas>1&&messdas<4000){spannung--;}else{spannung++;} warm=(analogRead(temp)*(0.5))+10; if(temper > warm&& warm>1&&warm<4000){temper--;}else{temper++;} } void pulspowder(void) { if(spannung<(laag[4]*100)){ for (uint8_t oft=0; oft"+String(laag[welch]),1,0xffff); } //for handling text and number disßplaying simpler void textso(int xhier,int yhier,String was,int gros,int16_t colz){tft.setTextColor(colz);tft.setCursor(xhier,yhier);tft.setTextSize(gros); tft.print(was);} void zahlso(int xda,int yda,int mich,int grosz,int16_t colc){String michauch=""; tft.setTextSize(grosz); tft.setCursor(xda,yda); tft.setTextColor(colc); if (mich <9) {michauch+="0";} if (mich <99) {michauch+="0";} if (mich <999) {michauch+="0";} michauch+=mich; tft.println(michauch);} //kote by marderchen =^.^= use if you want :3 STM32F103C8T6 93 board used