#include #include #include #include #include #define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); #define LED_PIN PB8 #define BRIGHTNESS 255 #define LED_TYPE WS2812 #define COLOR_ORDER GRB #define screeny 60 CRGB leds[screeny]; CRGBPalette16 currentPalette; TBlendType currentBlending; #define UPDATES_PER_SECOND 5000 extern CRGBPalette16 myRedWhiteBluePalette; #define power PB1 #define vbat PA0 #define rot PA4 #define grun PA7 #define blau PA6 #define uv PB5 #define weis PB0 #define c1 PB12 #define c2 PB13 #define c3 PB14 #define c4 PB15 #define c5 PA8 #define c6 PB9 #define c7 PB10 #define c8 PB4 #define temp1 PA1 #define temp2 PA2 #define temp3 PA3 #define temp4 PA5 long tim = millis(); // // Image data for powebank_bootscreen // const unsigned char PROGMEM meowscreen [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ##### 0x00, 0x00, 0x00, 0x00, 0x03, 0xFC, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, // ######## ####### 0x00, 0x00, 0x00, 0x40, 0x07, 0x80, 0x00, 0x3F, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, // # #### ########### ## 0x00, 0x00, 0x00, 0x60, 0x0C, 0x00, 0x00, 0x70, 0x1C, 0x03, 0x00, 0x00, 0x00, 0x00, // ## ## ### ### ## 0x00, 0x00, 0x00, 0x60, 0x0C, 0x00, 0x00, 0xE0, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, // ## ## ### ### ## 0x00, 0x00, 0x00, 0x70, 0x0C, 0x00, 0x00, 0xC0, 0x06, 0x06, 0x01, 0xC0, 0x00, 0x00, // ### ## ## ## ## ### 0x00, 0x00, 0x00, 0x70, 0x06, 0x00, 0x01, 0x80, 0x06, 0x06, 0x03, 0xC0, 0x00, 0x00, // ### ## ## ## ## #### 0x00, 0x00, 0x00, 0x70, 0x06, 0x1F, 0x01, 0x80, 0x06, 0x06, 0x07, 0xC0, 0x00, 0x00, // ### ## ##### ## ## ## ##### 0x00, 0x04, 0x00, 0x78, 0x07, 0xFE, 0x01, 0x80, 0x06, 0x06, 0x0E, 0xC0, 0x00, 0x00, // # #### ########## ## ## ## ### ## 0x00, 0x06, 0x00, 0x78, 0x03, 0xF0, 0x01, 0x80, 0x06, 0x06, 0x18, 0xC0, 0x30, 0x00, // ## #### ###### ## ## ## ## ## ## 0x00, 0x07, 0x00, 0x7C, 0x03, 0x00, 0x01, 0x80, 0x06, 0x06, 0x39, 0xC0, 0xF8, 0x00, // ### ##### ## ## ## ## ### ### ##### 0x00, 0x07, 0x80, 0x6C, 0x03, 0x00, 0x01, 0x80, 0x0C, 0x06, 0x71, 0x81, 0xC0, 0x00, // #### ## ## ## ## ## ## ### ## ### 0x00, 0x03, 0xC0, 0x6C, 0x03, 0x00, 0x01, 0x80, 0x0C, 0x06, 0xE1, 0x87, 0x80, 0x00, // #### ## ## ## ## ## ## ### ## #### 0x00, 0x03, 0xE0, 0x6E, 0x03, 0x3C, 0x00, 0xC0, 0x18, 0x06, 0xC3, 0x0E, 0x00, 0x00, // ##### ## ### ## #### ## ## ## ## ## ### 0x00, 0x03, 0xB8, 0x66, 0x03, 0xFF, 0x00, 0x60, 0x30, 0x07, 0xC3, 0x1C, 0x00, 0x00, // ### ### ## ## ########## ## ## ##### ## ### 0x00, 0x01, 0x9C, 0x67, 0x03, 0xC7, 0x00, 0x3F, 0xE0, 0x07, 0x83, 0x38, 0x00, 0x00, // ## ### ## ### #### ### ######### #### ## ### 0x00, 0x01, 0xC7, 0x63, 0x83, 0x00, 0x00, 0x1F, 0xC0, 0x06, 0x03, 0x70, 0x00, 0x00, // ### ### ## ### ## ####### ## ## ### 0x00, 0x01, 0xC7, 0xE1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x60, 0x00, 0x00, // ### ###### ## ## ## 0x00, 0x00, 0xC1, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, // ## #### #### 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, // ### # #### 0x00, 0x00, 0x60, 0x00, 0x3E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ## ##### # ## 0x00, 0x00, 0x60, 0x00, 0x3F, 0xC0, 0x38, 0x00, 0x3F, 0x80, 0x00, 0x80, 0x00, 0x00, // ## ######## ### ####### # 0x00, 0x00, 0x60, 0x00, 0x23, 0xF0, 0x28, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // ## # ###### # # # ######## 0x00, 0x00, 0x60, 0x00, 0x28, 0xF8, 0x6F, 0xC9, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, // ## # # ##### ## ###### # #### # 0x00, 0x00, 0x00, 0x00, 0x2E, 0x3D, 0xCC, 0x97, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, // # ### #### ### ## # # ##### # # 0x00, 0x00, 0x00, 0x00, 0x2F, 0x8F, 0x06, 0xA0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, // # ##### #### ## # # ### # 0x00, 0x00, 0x00, 0x00, 0x27, 0xE0, 0x01, 0x40, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, // # ###### # # #### # 0x00, 0x00, 0x00, 0x00, 0x37, 0xF7, 0xC1, 0x0E, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, // ## ####### ##### # ### ##### # 0x00, 0x00, 0x00, 0x00, 0x17, 0xE7, 0xE1, 0x10, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, // # ###### ###### # # ### # 0x00, 0x00, 0x00, 0x00, 0x13, 0xEF, 0xE2, 0x20, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // # ##### ####### # # # # 0x00, 0x00, 0x00, 0x00, 0x19, 0x8F, 0xA0, 0x4E, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, // ## ## ##### # # ### # ## 0x00, 0x00, 0x00, 0x00, 0x0D, 0x88, 0x20, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ## ## # # ### # 0x00, 0x00, 0x00, 0x00, 0x04, 0x8F, 0xE0, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // # # ####### # # 0x00, 0x00, 0x00, 0x00, 0x06, 0x08, 0x20, 0x0E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // ## # # ### # 0x00, 0x00, 0x00, 0x00, 0x02, 0x83, 0x87, 0x31, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // # # ### ### ## ## # # 0x00, 0x00, 0x00, 0x00, 0x03, 0x0C, 0x62, 0x0C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, // ## ## ## # ## ### 0x00, 0x00, 0x00, 0x00, 0x0C, 0x10, 0xC0, 0x03, 0x08, 0x00, 0x00, 0x00, 0x0C, 0x00, // ## # ## ## # ## 0x00, 0x00, 0x00, 0x00, 0x11, 0x03, 0x02, 0x00, 0xB2, 0x00, 0x00, 0x00, 0x1B, 0x00, // # # ## # # ## # ## ## 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0C, 0x04, 0xC0, 0x0C, 0x00, 0x00, 0x00, 0x11, 0x00, // ### ## # ## ## # # 0x00, 0x00, 0x00, 0x00, 0x02, 0x90, 0x24, 0x40, 0x04, 0x00, 0x00, 0x00, 0x19, 0x00, // # # # # # # # ## # 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x1B, 0x80, 0x6E, 0x00, 0x00, 0x01, 0x9B, 0x00, // # # ## ### ## ### ## ## ## 0x00, 0x00, 0x00, 0x00, 0x03, 0xF8, 0x00, 0x03, 0x90, 0x00, 0x00, 0x01, 0xCF, 0xC0, // ####### ### # ### ###### 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x06, 0x30, // # ## # # # ## ## 0x0F, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x37, 0x00, // #### ## ## ## # ## ### 0x19, 0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x08, 0x00, 0x00, 0x00, 0x8D, 0xF3, 0x00, // ## ## ## # # ## ##### ## 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00, 0xCD, 0xC1, 0x00, // # # # ## ## ## ### # 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x18, 0xCD, 0x98, 0x00, // ## # # ## ## ## ## ## 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00, 0x07, 0x18, 0xCC, 0xF8, 0x00, // ## # # # ### ## ## ## ##### 0x84, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x9C, 0xEC, 0x60, 0x00, // # # ## ###### ### ### ## ## 0xCC, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x3F, 0xCE, 0xBC, 0x00, 0x00, // ## ## ## ## #### ######## ### # #### 0x78, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xC7, 0x9C, 0x00, 0x00, // #### ## ## ## ## #### ## #### ### 0x00, 0xC6, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x38, 0x63, 0x8C, 0x00, 0x00, // ## ## #### # ## ### ## ### ## 0x00, 0x8C, 0x33, 0x20, 0x00, 0x00, 0x00, 0x00, 0x43, 0x38, 0x63, 0x80, 0x00, 0x00, // # ## ## ## # # ## ### ## ### 0x00, 0x98, 0x79, 0x63, 0x00, 0x00, 0x00, 0x00, 0x63, 0x18, 0x61, 0x80, 0x00, 0x00, // # ## #### # ## ## ## ## ## ## ## 0x00, 0xF8, 0x4E, 0x46, 0x3C, 0x8C, 0x70, 0x80, 0x63, 0x1C, 0xE0, 0x00, 0x00, 0x00, // ##### # ### # ## #### # ## ### # ## ## ### ### 0x00, 0x00, 0xC8, 0xCC, 0x10, 0x88, 0x88, 0x80, 0x36, 0x0F, 0xC0, 0x00, 0x00, 0x00, // ## # ## ## # # # # # # ## ## ###### 0x00, 0x00, 0x88, 0xD8, 0x31, 0x10, 0x88, 0x80, 0x3C, 0x0F, 0xC0, 0x00, 0x00, 0x00, // # # ## ## ## # # # # # #### ###### 0x00, 0x00, 0x08, 0xF0, 0x61, 0x31, 0xF8, 0x80, 0x18, 0x07, 0x80, 0x00, 0x00, 0x00, // # #### ## # ## ###### # ## #### 0x00, 0x00, 0x00, 0xC0, 0x41, 0x21, 0x08, 0x80, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, // ## # # # # # # ### 0x00, 0x00, 0x00, 0x01, 0xE1, 0xC3, 0x0C, 0xF0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // #### ### ## ## #### ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // ## }; const unsigned char PROGMEM cat1 [] = { 0x41, 0x00, // # # 0xA2, 0x80, // # # # # 0x00, 0x00, // 0x08, 0x00, // # 0x2A, 0x00, // # # # 0x14, 0x00, // # # }; const unsigned char PROGMEM cat2 [] = { 0x41, 0x00, // # # 0xE3, 0x80, // ### ### 0x00, 0x00, // 0x08, 0x00, // # 0x2A, 0x00, // # # # 0x16, 0x00, // # ## }; const unsigned char PROGMEM cat3[] = { 0x41, 0x00, // # # 0xA2, 0x80, // # # # # 0x41, 0x00, // # # 0x0C, 0x00, // ## 0x29, 0x00, // # # # 0x16, 0x00, // # ## }; const unsigned char PROGMEM smily1 [] = { 0x7D, 0x8F, 0x00, // ##### ## #### 0x9E, 0x7C, 0x80, // # #### ##### # 0xA8, 0x0A, 0x80, // # # # # # # 0x92, 0x24, 0x80, // # # # # # # 0x55, 0x55, 0x00, // # # # # # # # # 0x60, 0x03, 0x00, // ## ## 0x20, 0xC2, 0x00, // # ## # 0x20, 0x02, 0x00, // # # 0x12, 0x94, 0x00, // # # # # # 0x11, 0x64, 0x00, // # # ## # 0x08, 0x08, 0x00, // # # 0x06, 0x30, 0x00, // ## ## 0x01, 0xC0, 0x00, // ### }; const unsigned char PROGMEM stern1 [] = { 0x80, // # }; const unsigned char PROGMEM stern2 [] = { 0x40, // # 0xE0, // ### 0x40, // # }; const unsigned char PROGMEM stern3 [] = { 0x40, // # 0xA0, // # # 0x40, // # }; const unsigned char PROGMEM stern4 [] = { 0x20, // # 0x20, // # 0xD8, // ## ## 0x20, // # 0x20, // # }; const unsigned char PROGMEM stern5 [] = { 0xA8, // # # # 0x00, // 0x88, // # # 0x00, // 0xA8, // # # # }; const unsigned char PROGMEM stern6 [] = { 0x92, // # # # 0x54, // # # # 0x00, // 0xC6, // ## ## 0x00, // 0x54, // # # # 0x92, // # # # }; const unsigned char PROGMEM stern7 [] = { 0x10, // # 0x00, // 0x00, // 0x82, // # # 0x00, // 0x00, // 0x10, // # }; const unsigned char PROGMEM herz2 [] = { 0x60, 0xC0, // ## ## 0x91, 0x20, // # # # # 0x8E, 0x20, // # ### # 0x80, 0x20, // # # 0x40, 0x40, // # # 0x40, 0x40, // # # 0x20, 0x80, // # # 0x1B, 0x00, // ## ## 0x04, 0x00, // # }; const unsigned char PROGMEM herz1 [] = { 0x66, // ## ## 0x99, // # ## # 0x81, // # # 0x42, // # # 0x24, // # # 0x18, // ## }; int dcltemp1 =0; int battemp2=0; int battemp3=0; int suptemp4=0; int batvol =0; void setup(){ delay(250); pinMode(power, OUTPUT); pinMode(uv, OUTPUT); pinMode(rot, OUTPUT); pinMode(blau, OUTPUT); pinMode(grun, OUTPUT); pinMode(weis, OUTPUT); pinMode(c1, INPUT); pinMode(c2, INPUT); pinMode(c3, INPUT); pinMode(c4, INPUT); pinMode(c5, INPUT); pinMode(c6, INPUT); pinMode(c7, INPUT); pinMode(c8, INPUT); delay(200); digitalWrite(power, HIGH); display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) display.clearDisplay(); FastLED.addLeds(leds, screeny).setCorrection( TypicalLEDStrip ); FastLED.setBrightness( BRIGHTNESS ); currentPalette = RainbowColors_p; currentBlending = BLEND; } int cutmarker =100; int cutist =0; int countz =0; int brighty=255; boolean frei =false; void loop(){ display.fillRect(0,0,128,64,BLACK); pixels(); regenbogen(); readmessi(); powercutting(); ledspectrum(); info(); if (countz >149 && frei==true){ x20y64pxfun();} display.display(); } int offcountz =0; int color =0; int color2 =0; void pixels(void) { //digitalWrite(uv, HIGH); //digitalWrite(blau, HIGH); //digitalWrite(rot, HIGH); display.drawBitmap(12,2, meowscreen,112, 61, WHITE); //breite und höhe der sichtbaren caracter wichtig sonst bildstreifen display.drawCircle(64,32,countz/2 +10, WHITE); display.drawCircle(64,32,countz/1.8 +9, WHITE); display.drawCircle(64,32,countz/1.6 +9, WHITE); display.drawCircle(64,32,countz/1.4 +9, WHITE); display.drawCircle(64,32,countz/1.2 +9, WHITE); if (countz >150) { display.fillRect(0,0,128,64,BLACK); display.drawRect(1,0,98,9,WHITE ); display.setTextColor(WHITE); display.setTextSize(1); display.setCursor(6,1); display.print("MEOW =^.^= Info"); display.setCursor(0,10); display.print("DC/DC-temp>"); if((dcltemp1/10) <= 999) { display.print(" ");} if((dcltemp1/10) <= 99) { display.print(" ");} if((dcltemp1/10) <= 9) { display.print(" ");} display.print(dcltemp1/10); display.print(" C"); display.setCursor(0,20); display.print("batttemp 1>"); if((battemp2/10) <= 999) { display.print(" ");} if((battemp2/10) <= 99) { display.print(" ");} if((battemp2/10) <= 9) { display.print(" ");} display.print(battemp2/10); display.print(" C"); display.setCursor(0,30); display.print("batttemp 2>"); if((battemp3/10) <= 999) { display.print(" ");} if((battemp3/10) <= 99) { display.print(" ");} if((battemp3/10) <= 9) { display.print(" ");} display.print(battemp3/10); display.print(" C"); display.setCursor(0,40); display.print("supplytemp>"); if((suptemp4/10) <= 999) { display.print(" ");} if((suptemp4/10) <= 99) { display.print(" ");} if((suptemp4/10) <= 9) { display.print(" ");} display.print(suptemp4/10); display.print(" C"); display.setCursor(0,54); display.print("cell-Power>"); if((batvol/40) <= 999) { display.print(" ");} if((batvol/40) <= 99) { display.print(" ");} if((batvol/40) <= 9) { display.print(" ");} display.print(batvol/40); display.print(" %"); display.drawLine(0,18,dcltemp1/10,18, WHITE); display.drawLine(cutist,19,cutist,19, WHITE); display.drawLine(cutmarker,18,cutmarker,19, WHITE); display.drawLine(0,28,battemp2/10,28, WHITE); display.drawLine(cutist,29,cutist,29, WHITE); display.drawLine(cutmarker,28,cutmarker,29, WHITE); display.drawLine(0,38,battemp3/10,38, WHITE); display.drawLine(cutist,39,cutist,39, WHITE); display.drawLine(cutmarker,38,cutmarker,39, WHITE); display.drawLine(0,48,suptemp4/10,48, WHITE); display.drawLine(cutist,49,cutist,49, WHITE); display.drawLine(cutmarker,48,cutmarker,49, WHITE); display.drawLine(0,63,batvol/30,63, WHITE); frei=true; }else{ countz++; } } void regenbogen(void){ color2+=(batvol/3)%10; color =color2; for( int i = 8; i > 0; i--) { color+=50-((batvol/2)%10); leds[i] = ColorFromPalette( currentPalette,255-color, brighty, currentBlending); leds[16-i] = ColorFromPalette( currentPalette,255-color, brighty, currentBlending); } FastLED.show(); FastLED.delay(1000 / 2000); } int slowz =0; boolean alarm =false; void readmessi(void){ slowz++; if (slowz >2) {slowz=0; if (dcltemp1 < (analogRead(temp1)-2000)) {dcltemp1+=3;} if (dcltemp1 > (analogRead(temp1)-2000)) {dcltemp1-=3;} if (battemp2 < (analogRead(temp2)-2000)) {battemp2+=3;} if (battemp2 > (analogRead(temp2)-2000)) {battemp2-=3;} if (battemp3 < (analogRead(temp3)-2000)) {battemp3+=3;} if (battemp3 > (analogRead(temp3)-2000)) {battemp3-=3;} if (suptemp4 < (analogRead(temp4)-2000)) {suptemp4+=3;} if (suptemp4 > (analogRead(temp4)-2000)) {suptemp4-=3;} if (batvol < (analogRead(vbat))) {batvol+=6;} if (batvol > (analogRead(vbat))) {batvol-=6;} } } int unlocktz =100; int unlocktz2 =0; int alarmt =0; int alarmt2=0; void powercutting(void){ if (digitalRead(c1) ==HIGH && digitalRead(c7) == HIGH) { frei=false; offcountz+=15; display.fillRect(0,0,128,64,BLACK); display.setTextSize(3); display.setCursor(0,10); display.setTextColor(WHITE); display.print("OFF in:"); display.setTextSize(3); display.setCursor(40,40); display.print(1000-offcountz); } else {offcountz=0;} if (offcountz >1000) {digitalWrite(power, LOW);} if (digitalRead(c2) ==HIGH && digitalRead(c8) == HIGH) { frei =false; unlocktz-=2; display.fillRect(0,0,128,64,BLACK); display.setTextSize(3); display.setCursor(0,10); if (unlocktz >2) { display.print("UNLOCK~");} if (unlocktz <2) { display.print("");} display.setTextSize(3); display.setCursor(40,40); if (unlocktz%10 <=9) {display.print(" ");} display.print(unlocktz/10); } if (unlocktz <=2) {unlocktz2++;} if (unlocktz2>200) {unlocktz=100; unlocktz2=0;} if (unlocktz != 100) { if (digitalRead(c3) ==HIGH) {cutmarker--;} if (digitalRead(c4) ==HIGH) {cutmarker++;} } if (cutist < (((dcltemp1/10) + (battemp2/10) + (battemp3/10) + (suptemp4/10) ) /4)) {cutist++;} if (cutist > (((dcltemp1/10) + (battemp2/10) + (battemp3/10) + (suptemp4/10) ) /4)) {cutist--;} if (cutist >cutmarker) {alarm=true; alarmt++; alarmt2++;} else {alarm = false; alarmt =0; alarmt2=0;} if (alarmt ==10) { digitalWrite(rot, HIGH);} if (alarmt ==30) { digitalWrite(blau, HIGH); digitalWrite(uv, HIGH);} if (alarmt ==40) { digitalWrite(weis, LOW); digitalWrite(uv, LOW); digitalWrite(rot, LOW);digitalWrite(grun, LOW);digitalWrite(blau, LOW); } if (alarmt ==60) { digitalWrite(weis, HIGH);} if (alarmt ==70) { digitalWrite(weis, LOW); digitalWrite(uv, HIGH);} if (alarmt ==80) { digitalWrite(uv, LOW);} if (alarmt ==90) {alarmt=0;} if (alarmt2 >200) {digitalWrite(power, LOW);} if (alarmt2 >1 && (alarmt2%2) ==0) { display.fillRect(0,48,128,16,BLACK); display.setTextSize(2); display.setCursor(0,48); display.setTextColor(WHITE); display.print("HEATING !"); display.print(alarmt2); } if (alarmt2 >1 && (alarmt2%2) ==1) { display.fillRect(0,48,128,16,WHITE); display.setTextSize(2); display.setCursor(0,48); display.setTextColor(BLACK); display.print("HEATING !"); display.print(20-(alarmt2/10)); } } int colormody=1; int ledon =0; int slow =0; void ledspectrum(void){ slow++; if (slow >2) { slow=0; if (unlocktz != 100) { if (digitalRead(c6) ==HIGH) {colormody++; if (brighty <245){brighty+=10;}} if (colormody > 12) {colormody=1;} if (digitalRead(c5) ==HIGH) {ledon++; brighty-=10;} if (ledon >=2) { ledon =0; digitalWrite(weis, LOW); digitalWrite(uv, LOW); digitalWrite(rot, LOW);digitalWrite(grun, LOW);digitalWrite(blau, LOW);} if (ledon ==1) { if (colormody ==1) {digitalWrite(uv, HIGH);} if (colormody ==2) {digitalWrite(blau, HIGH);} if (colormody ==3) {digitalWrite(rot, HIGH);} if (colormody ==4) {digitalWrite(grun, HIGH);} if (colormody ==5) {digitalWrite(weis, HIGH);} }} }} int murmurpos =0; int murmursize=1; int welchfun =0; int welchfuncount=0; int welchfunint =0; #define katzen 30 #define sterne 100 #define herzen 50 #define smilys 20 uint8_t zufallz[10]= {5,5,5,5,5,5,5,5,5}; boolean okes[5]={false,false,false,false}; int stx=0; int sty=0; int stp=0; int cax=0; int cay=0; int cap=0; int hzx=0; int hzy=0; int hzp=0; int smx=0; int smy=0; int smp=0; uint8_t sterney[sterne][25]; uint8_t catz[katzen][20]; uint8_t sm[smilys][15]; uint8_t hert[herzen][15]; int16_t gff =128; void x20y64pxfun(void){ murmurpos+=random(0,2); if (murmurpos >65) {murmurpos=0;} for (int is = 0; is < random(1,8+murmurpos*1.5); is++) { murmursize =random(0,28); display.drawLine(murmursize +100,murmurpos+is,murmursize +100+random(0,3),murmurpos+is,WHITE); if (is == random(1,2)) {murmursize =random(0,128); display.drawLine(murmursize ,murmurpos+is,murmursize +random(0,5),murmurpos+is,WHITE);} } // welchfuncount++; if (welchfuncount > welchfunint) { // welchfunint = random(50,200); welchfuncount =0; welchfun =random(0,3); //zufallz[0]=random(5,20); zufallz[1]=random(4,10); zufallz[2]=random(4,20); zufallz[3]=random(1,6); for (uint8_t kk=0; kk< 4; kk++){okes[kk]=false;} } if (welchfun ==1) { //sterne uint8_t sterney[sterne][25]; for (uint8_t f1=0; f1< zufallz[0]; f1++) { sterney[f1][stx] = random(0,40); sterney[f1][sty] = random(0,64); if (zufallz[0] >= f1) {okes[0]=true;} } if (okes[0]==true) { for (uint8_t g1=0; g1< zufallz[0]; g1++) { // sterney[g1][sty] *= 1.02; sterney[g1][stx] += random(0,1); // if ( sterney[g1][stx] >10) {sterney[g1][stx] -=random(0,2);} if(sterney[g1][sty] >64) {sterney[g1][sty] = random(0,10);} stp++; if (stp == 1) { display.drawBitmap((sterney[g1][stx]) +80 +3, (sterney[g1][sty]) +3,stern1,1, 1, WHITE); } if (stp == 2) { display.drawBitmap((sterney[g1][stx]) +80 +2, (sterney[g1][sty]) +2,stern2,3, 3, WHITE); } if (stp == 3) { display.drawBitmap((sterney[g1][stx]) +80 -2, (sterney[g1][sty]) +2,stern3,3, 3, WHITE); } if (stp == 4) { display.drawBitmap((sterney[g1][stx]) +80 +1, (sterney[g1][sty]) +1,stern4,5, 5, WHITE); } if (stp == 5) { display.drawBitmap((sterney[g1][stx]) +80 +1, (sterney[g1][sty]) +1,stern5,5, 5, WHITE); } if (stp == 6) { display.drawBitmap(sterney[g1][stx] +80 , sterney[g1][sty] ,stern6,7, 7, WHITE); } if (stp == 8) { display.drawBitmap(sterney[g1][stx] +80 , sterney[g1][sty] ,stern7,7, 7, WHITE); } if (stp == 9) { stp = 1; } }display.display(); } } if (welchfun ==2) { //katzen if (okes[1]==false) { for (uint8_t f2=0; f2< zufallz[1]; f2++) { catz[f2][cax] = random(0,40); catz[f2][cay] = random(0,10); if (zufallz[1] >= f2) {okes[1]=true;} }} if (okes[1]==true) { for (uint8_t g2=0; g2< zufallz[1]; g2++) { // catz[g2][cay] *= 1.02; catz[g2][cay] += random(0,1); // if (catz[g2][cax]>10) { catz[g2][cax] -=2 +random(0,4);} if(catz[g2][cay] >64) {catz[g2][cay] = random(0,10);} cap++; if (cap == 1) { display.drawBitmap(catz[g2][cax] +80, catz[g2][cay],cat1,9, 9, WHITE); } if (cap == 2) { display.drawBitmap(catz[g2][cax] +80, catz[g2][cay],cat2,9, 9, WHITE); } if (cap == 3) { display.drawBitmap(catz[g2][cax] +80, catz[g2][cay],cat3,9, 9, WHITE); } if (cap == 4) { cap = 1; } } } } if (welchfun ==3) { //herzen if (okes[2]==false) { for (uint8_t f3=0; f3< zufallz[2]; f3++) { hert[f3][hzx] = random(0,20); hert[f3][hzy] = random(0,10); if (zufallz[2] >= f3) {okes[2]=true;} }} if (okes[2]==true) { for (uint8_t g3=0; g3< zufallz[2]; g3++) { // hert[g3][hzy] *= 1.02; hert[g3][hzy] += random(0,1); // hert[g3][hzx] -=2 +random(0,4); if(hert[g3][hzy] >64) {hert[g3][hzy] = random(0,10);} hzp++; if (hzp == 1) { display.drawBitmap(hert[g3][hzx] +80 +2, hert[g3][hzy] +2,herz2,8, 8, WHITE); } if (hzp == 2) { display.drawBitmap(hert[g3][hzx] +80 , hert[g3][hzy] ,herz2,11, 11, WHITE); } if (hzp == 3) { hzp = 1; } } }} if (welchfun ==3) { //herzen if (okes[3]==false) { for (uint8_t f4=0; f4< zufallz[3]; f4++) { sm[f4][smx] = random(0,10); sm[f4][smy] = random(0,10); if (zufallz[3] >= f4) {okes[3]=true;} }} if (okes[3]==true) { for (uint8_t g4=0; g4< zufallz[2]; g4++) { // sm[g4][smy] *= 1.02; sm[g4][smy] += random(0,1); // sm[g4][smx] -=2 +random(0,4); if(sm[g4][smy] >64) {sm[g4][smy] = random(0,10);} display.drawBitmap(sm[g4][hzx] +80, sm[g4][hzy],smily1,17, 17, WHITE); } }} gff++; if (gff >64) {gff=0;} for (uint8_t gf=0; gf< 196; gf++) { if ((gf%8)==0) { if ((gf-gff)>0 &&(gf-gff)<96) { display.drawLine(104,57,127,gf-gff,WHITE);} } } } int16_t xxx=0; int16_t yyy=128; int slowx=0; boolean infog=false; void info(void) { if(countz >148) { if (digitalRead(c3) ==HIGH && digitalRead(c6) == HIGH) {frei =false;infog=true;} if (infog==true) { display.fillRect(0,0,128,64,BLACK); cap++; if (cap == 1) { display.drawBitmap(xxx +60, yyy-64,cat1,9, 9, WHITE); } if (cap == 2) { display.drawBitmap(xxx +60,yyy-64,cat2,9, 9, WHITE); } if (cap == 3) { display.drawBitmap(xxx +60,yyy-64,cat3,9, 9, WHITE); } if (cap == 4) { cap = 1; } display.setTextSize(1); display.setCursor(xxx,yyy+9-64); display.setTextColor(WHITE); display.print("Deverloper:marderchen"); display.print("> www.marderchen.de <"); display.print("Capacity: 364000 mAh"); display.print("OUTPUT : 5V 8000 mAh"); display.print("Supply : 5V 4000 mAh"); display.print("LEDPOWER: 18 Watt"); display.print("Sound : 2x 3 Watt"); display.print("Overheating and over-"); display.print("Overcharging and also"); display.print("SHORT-cut Protection!"); display.print("CHIP: STM32F103C8T6 -"); display.print("72Mhz, 128kB FLASH, "); display.print("20kB RAM MEOW! ~~~~~~"); display.print("survival powerbank #"); display.print("16x WS2812 be free!!!"); display.print("1onlinein; /wuselcode"); display.drawBitmap(xxx +55, yyy +60,smily1,17, 17, WHITE); } slowx++; if (slowx >3) {yyy--; slowx=0;} if (yyy <=1) {yyy=128; frei=true; infog =false;}} } //benutztes programm um aus bmp character array zu machen : The dot factory v1.0.4 //MEOW! its free use it or parts if there is somethink usefull for you //code by marderchen =^.^=