//2.8" 320x240pc none touchscreen ili9341 + ws2812 + ? 550.000mA oszilator or powervapedriver *arduino ide ** STM32F103C9T6 (128kB flash!) -> 85.072 Bytes (64%) used caused fastledlib //MEOW currently functions testing I/O and components (working) //for switching pin with up to 800kHz !thanks #include "speakerpin.h" #define powerpin PB0 #define mossignalon pinMode(powerpin, OUTPUT) #define mosfets1 digitalWrite(powerpin, HIGH) #define mosfets0 digitalWrite(powerpin, LOW) #define tonpin PB15 #define toninit pinMode(tonpin, OUTPUT) #define ton1 digitalWrite(tonpin, HIGH) #define ton0 digitalWrite(tonpin, LOW) #define lcdback PB11 #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define DARKGREEN 0x03E0 #define CYAN 0x07FF #define PURPLE 0x780F #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF //ws2812 #include #define LED_PIN PB8 #define BRIGHTNESS 255 #define LED_TYPE WS2812 #define COLOR_ORDER GRB #define screeny 16 CRGB leds[screeny]; CRGBPalette16 currentPalette; TBlendType currentBlending; #define UPDATES_PER_SECOND 5000 extern CRGBPalette16 myRedWhiteBluePalette; // ili9341 2.8" tft #include "SPI.h" #include "Adafruit_GFX_AS.h" #include "Adafruit_ILI9341_STM.h" #define TFT_CS PB14 #define TFT_DC PB13 #define TFT_RST PA8 #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); //temperaturfühler #define tres1 PA3 #define tres2 PA4 #define tres3 PB1 // battereiettemp //opptokoplermesser #define opto1 PA0 //bnatteriespannung 3.046V 1810 4.14V 3820 #define opto2 PA1 #define opto3 PA2 #define opto4 PA10 //highlow batterieladent //display taster #define t1 PA11 #define t2 PA12 #define t3 PA15 #define t4 PC14 #define t5 PC15 //high power LED/farben NPN trans. #define UV PB6 #define rot PC13 #define grun PA9 #define blau PB10 //vapebutton #define tast PB7 long color =0; long colorc =0; int g = 0; int f1 = 0; int r=0; uint32_t rainbow[129] = {0xff0000,0xff0500,0xff0a00,0xff0f00,0xff1400,0xff1900,0xff1e00,0xff2400,0xff2900,0xff2e00,0xff3300,0xff3800,0xff3d00,0xff4200,0xff4700,0xff4c00,0xff5100,0xff5600,0xff5b00,0xff6100,0xff6600,0xff6b00,0xff7000,0xff7500,0xff7a00,0xff7f00,0xff8400,0xff8900,0xff8e00,0xff9300,0xff9800,0xff9d00,0xffa100,0xffa600,0xffab00,0xffb000,0xffb500,0xffba00,0xffbf00,0xffc400,0xffc900,0xffce00,0xffd300,0xffd800,0xffdd00,0xffe100,0xffe600,0xffeb00,0xfff000,0xfff500,0xfffa00,0xffff00,0xf5ff00,0xebff00,0xe0ff00,0xd6ff00,0xccff00,0xc2ff00,0xb8ff00,0xadff00,0xa3ff00,0x99ff00,0x8fff00,0x85ff00,0x7aff00,0x70ff00,0x66ff00,0x5cff00,0x52ff00,0x47ff00,0x3dff00,0x33ff00,0x29ff00,0x1fff00,0x14ff00,0x0aff00,0x00ff00,0x00ff0a,0x00ff14,0x00ff1d,0x00ff27,0x00ff31,0x00ff3b,0x00ff45,0x00ff4e,0x00ff58,0x00ff62,0x00ff6c,0x00ff76,0x00ff80,0x00ff89,0x00ff93,0x00ff9d,0x00ffa7,0x00ffb1,0x00ffba,0x00ffc4,0x00ffce,0x00ffd8,0x00ffe2,0x00ffeb,0x00fff5,0x00ffff,0x00f5ff,0x00ebff,0x00e0ff,0x00d6ff,0x00ccff,0x00c2ff,0x00b8ff,0x00adff,0x00a3ff,0x0099ff,0x008fff,0x0085ff,0x007aff,0x0070ff,0x0066ff,0x005cff,0x0052ff,0x0047ff,0x003dff,0x0033ff,0x0029ff,0x001fff,0x0014ff,0x000aff,0x0000ff}; uint32_t grays[5] = {0x000000,0x808080,0xffffff}; int b=0; long tim = millis(); long mosz = millis(); int speedb=0; int speedc=0; int maintime =millis(); int8_t digbright5; void setup () { delay(500); pinMode(UV, OUTPUT); pinMode(rot, OUTPUT); pinMode(grun, OUTPUT); pinMode(blau, OUTPUT); pinMode(lcdback, OUTPUT); pinMode(opto4, INPUT); pinMode(tast, INPUT); pinMode(t1, INPUT); pinMode(t2, INPUT); pinMode(t3, INPUT); pinMode(t4, INPUT); pinMode(t5, INPUT); mossignalon; toninit; FastLED.addLeds(leds, screeny).setCorrection( TypicalLEDStrip ); FastLED.setBrightness( BRIGHTNESS ); currentPalette = RainbowColors_p; currentBlending = BLEND; tft.begin(); tft.fillScreen(ILI9341_BLACK); tft.setRotation(2); drawdoszistuf(); } int temp1,temp2,temp3,zeit1; int8_t load=120; int8_t often=120; int8_t mss =50; int8_t standbytrig=3; int16_t brightz =20; int8_t changevalue=127; int16_t posdraw=0; int8_t LCDLEDbright=20; //(0-20) 60=max; int16_t errortemp=145; //signaltemp; int16_t alarmtime=425; //7uhr morgens **min nach 0uhr long uhrzeit= 72000; //zeit 72000 = 20uhr int16_t runday=0; int colorw =0; int ccount1=0; int ccount2=0; int ccount1a=0; int ccount2a=0; int16_t colorplus=4; //steigerung für nächsten text int8_t changepos=0; int32_t puffs=0; void loop () { readmessi(); WS2812rainbow(); istinput(); readmessi(); zeitreise(); mospower(); wuselbild(); changedraw(changepos); } int8_t onpress[17]; void displayr() { tft.fillRect(0,0,240,150,BLACK); drawdoszistuf(); } int16_t bathis[231]; int16_t temp1his[231]; int16_t temp2his[231]; int16_t temp3his[231]; int16_t graphposx=6; int16_t graphposy=155; int16_t graphwidth=230; int16_t graphheight=150; void graphdraw() { // graph raster tft.fillRect(0,90,240,230,BLACK); for (int16_t lsie = 0; lsie < (graphheight+10); lsie++){ if ((lsie%2)==0) { tft.drawPixel(graphposx-1,lsie+graphposy,BLUE);} if ((lsie%8)==0) { tft.drawPixel(graphposx-2,lsie+graphposy,BLUE);} if ((lsie%16)==0) { tft.drawFastHLine(graphposx,lsie+graphposy,graphwidth,BLUE);} } for (int16_t sie = graphwidth; sie > 0; sie--){ if ((sie%2)==0) { tft.drawPixel(graphposx-1+sie,graphposy+graphheight+8,BLUE);} if ((sie%8)==0) { tft.drawPixel(graphposx-1+sie,graphposy+graphheight+9,BLUE);} if ((sie%16)==0) { tft.drawFastVLine(graphposx-2+sie,graphposy,graphheight+7,BLUE);} } for (int16_t lsi = 0; lsi < graphwidth; lsi++){ tft.drawPixel(lsi+graphposx,graphposy+graphheight+10-bathis[lsi],WHITE); tft.drawPixel(lsi+graphposx,graphposy+graphheight+10-temp1his[lsi],GREEN); tft.drawPixel(lsi+graphposx,graphposy+graphheight+10-temp2his[lsi],CYAN); tft.drawPixel(lsi+graphposx,graphposy+graphheight+10-temp3his[lsi],PURPLE); } wuselline(posdraw+graphposx,graphposy,posdraw+graphposx,graphposy+160,1,1,true); tft.drawRect(graphposx-5,graphposy-1,graphwidth+6,graphheight+14,CYAN); //temperature texte tft.setTextColor(YELLOW); tft.setTextSize(1); tft.setCursor(0,90); tft.print("Temps: \n"); tft.setTextColor(GREEN); tft.print("Mosfet\n "); if (temp1his[posdraw-1] <=9) {tft.print("0");} if (temp1his[posdraw-1] <=99) {tft.print("0");} tft.print(temp1his[posdraw-1]); tft.print("\n"); tft.setTextColor(CYAN); tft.print("FeCore\n "); if (temp2his[posdraw-1] <=9) {tft.print("0");} if (temp2his[posdraw-1] <=99) {tft.print("0");} tft.print(temp2his[posdraw-1]); tft.print("\n"); tft.setTextColor(PURPLE); tft.print("Li-po \n "); if (temp3his[posdraw-1] <=9) {tft.print("0");} if (temp3his[posdraw-1] <=99) {tft.print("0");} tft.print(temp3his[posdraw-1]); //akkupowerregenbogengraph tft.setTextColor(WHITE); tft.setCursor(40,132); tft.print("CELL-POWER:"); if ((analogRead(opto1)-2300) <=9) {tft.print("0");} if ((analogRead(opto1)-2300) <=99) {tft.print("0");} tft.print(analogRead(opto1)); tft.print(" "); for (int16_t bat = 0; bat < 200; bat++){ if (bat < ((analogRead(opto1)-2800)/1.5)) {colory(rainbow[round(bat*0.64)]); tft.drawFastVLine(40+bat,140,8,tft.color565(r,g,b));} } tft.drawRect(39,140,200,10,WHITE); //sonstiges tft.setTextColor(MAGENTA); if (puffs <=9) {tft.print("0");} if (puffs <=99) {tft.print("0");} if (puffs <=999) {tft.print("0");} tft.print(puffs); tft.print("puffs "); tft.setTextColor(GREEN); if (runday <=9) {tft.print("0");} if (runday <=99) {tft.print("0");} tft.print(runday); tft.print("days"); } void istinput() { if (zeit1 >=1) { if (digitalRead(t1) == HIGH && onpress[8] ==0) { onpress[8] =1; changepos+=1; displayr();} if (onpress[8] == 1) { onpress[9]++;} if (onpress[9] >= 5) { onpress[9] =0; onpress[8]=0; } if (digitalRead(t2) == HIGH && onpress[10] ==0) { onpress[10] =1; changepos-=1; displayr();} if (onpress[10] == 1) { onpress[11]++;} if (onpress[11] >= 5) { onpress[11] =0; onpress[10]=0; } if (digitalRead(t3) == HIGH && onpress[12] ==0) { onpress[12] =1; changethis(changepos,true); displayr();} //zeitc -signal if (onpress[12] == 1) { onpress[13]++;} if (onpress[13] >= 3) { onpress[13] =0; onpress[12]=0; } if (digitalRead(t4) == HIGH && onpress[14] ==0) { onpress[14] =1; changethis(changepos,false); displayr();} if (onpress[14] == 1) { onpress[15]++;} if (onpress[15] >= 3) { onpress[15] =0; onpress[14]=0; } zeit1=0; }} int batvol=200; void changedraw(int8_t wass) { if (wass ==0) {wuselrect(1,14,118,40,1,2,true);} if (wass ==1) {wuselrect(121,14,118,40,1,2,true);} if (wass ==2) {wuselrect(1,57,118,31,1,2,true);} if (wass ==3) {wuselrect(121,57,118,11,1,1,true);} if (wass ==4) {wuselrect(121,67,118,11,1,1,true);} if (wass ==5) {wuselrect(190,77,19,11,1,1,true);} if (wass ==6) {wuselrect(208,77,19,11,1,1,true);} if (wass ==7) {wuselrect(37,89,61,41,1,1,true);} if (wass ==8) {wuselrect(107,89,61,41,1,1,true);} if (wass ==9) {wuselrect(177,89,61,41,1,1,true);} if (wass ==10) {wuselrect(177,89,61,41,1,1,true);} } void changethis(int8_t was,boolean updown){ if (was ==0) { //load **länge der impulsdauer if (updown ==true && load <=117) {load+=3;} if (updown ==false && load >=2) {load-=2;}} if (was ==1) { //often **wieviele loads dutys in einem often if (updown ==true && often <=117) {often+=3;} if (updown ==false && often >=2) {often-=2;}} if (was ==2) { //mss **wieviele oftens in einer microsekunde(wenn länder dauert wieviele oftens für einmal vapen) abgearbeitet werden if (updown ==true && load <=117) {mss+=3;} if (updown ==false && load >=2) {mss-=2;}} if (was ==3) { //ledback **wieviele 10tel sekunden die 2x470yF kondensatoren an 5V (mit 18Ohm wiederstand zu LCD backlight) in 6sekunden geladen werden if (updown ==true && LCDLEDbright <=57) {LCDLEDbright+=3;}//+ auf welche helligkeit WS2812/B zurückgefahren werden (60=240brigth) if (updown ==false && LCDLEDbright >=2) {LCDLEDbright-=2;}} if (was ==4) { //wenn eine der 3 temperaturfühler (für lipofühlerist der wert 50geringer) wert überschreitet dampfen verhintert und signale(audio? ledblitz) if (updown ==true && errortemp <=187) {errortemp+=3;} if (updown ==false && errortemp >=2) {errortemp-=2;}} if (was ==5) { //alarmzeit ändern stunden if (updown ==true && alarmtime <=1380) {alarmtime+=60;} if (updown ==false && alarmtime >=60) {alarmtime-=60;}} if (was ==6) { //alarmzeit änder minuten if (updown ==true && alarmtime <=1438) {alarmtime+=3;} if (updown ==false && alarmtime >=2) {alarmtime-=2;}} if (was ==7) { //uhrzeit änder stunden if (updown ==true && uhrzeit <=82800) {uhrzeit+=3600;} if (updown ==false && uhrzeit >=3600) {uhrzeit-=3600;}} if (was ==8) { //uhrzeit änder minuten if (updown ==true && uhrzeit <=86220) {uhrzeit+=180;} if (updown ==false && uhrzeit >=120) {uhrzeit-=120;}} if (was ==9) { //uhrzeit änder sekunden if (updown ==true && uhrzeit <=86397) {uhrzeit+=3;} if (updown ==false && uhrzeit >=2) {uhrzeit-=2;}} if (was ==10){ //standbyblitzen häufigkeit if (updown ==true && standbytrig <=15) {standbytrig++;} if (updown ==false && standbytrig >=1) {standbytrig--;}} if (changepos >= 11) {changepos=0;} } void readmessi(void){ if (temp1 < (analogRead(tres1)-2000)/10) {temp1 +=1;} if (temp1 > (analogRead(tres1)-2000)/10) {temp1-=1;} if (temp2 < (analogRead(tres2)-2000)/10) {temp2+=1;} if (temp2 > (analogRead(tres2)-2000)/10) {temp2-=1;} if (temp3 < (analogRead(tres3)-2000)/10) {temp3+=1;} if (temp3 > (analogRead(tres3)-2000)/10) {temp3-=1;} if (batvol < ((analogRead(opto1)-2850)/1.25)) {batvol+=1;} if (batvol > ((analogRead(opto1)-2850)/1.25)) {batvol-=1;} temp1his[posdraw] = (analogRead(tres1)-2000)/10; temp2his[posdraw] = (analogRead(tres2)-2000)/10; temp3his[posdraw] = (analogRead(tres3)-2000)/10; bathis[posdraw] = batvol; } void drawdoszistuf(void){ //load colory(0x0000ff); tft.drawFastVLine(0,41,14, tft.color565(r,g,b)); tft.drawFastHLine(0,55,120, tft.color565(r,g,b)); colory(0x00ffff); for( int id = 0; id < load; id++) { tft.drawFastVLine(id,36,15, tft.color565(r,g,b));} tft.drawFastHLine(load,51,120-load, tft.color565(r,g,b)); //often colory(0xff0000); tft.drawFastVLine(120,41,14, tft.color565(r,g,b)); tft.drawFastHLine(120,55,120, tft.color565(r,g,b)); colory(0xff00ff); for( int ido = 120; ido < (often+120); ido++) { if ((ido%2)==1) {colory(0x00ffff);} if ((ido%2)==0) {colory(0xff00ff);} tft.drawFastVLine(ido,36,15, tft.color565(r,g,b));} tft.drawFastHLine(often+120,51,240-often, tft.color565(r,g,b)); //micros colory(0xffff00); tft.drawLine(0,76,0,86, tft.color565(r,g,b)); tft.drawLine(0,86,120,86, tft.color565(r,g,b)); colory(0xffffff); for( int ids = 0; ids < mss; ids++) { if ((ids%2)==1) {colory(0xffffff);} if ((ids%2)==0) {colory(0x00ff00);} tft.drawFastVLine(ids,76,9, tft.color565(r,g,b));} tft.drawFastHLine(mss,85,120-mss, tft.color565(r,g,b)); } int zeitzis[6]; int8_t ladevollblink =0; int8_t LCDLEDbrightc=0; long maintime2=millis(); long maintime3=millis(); void zeitreise(void){ while ((millis()- maintime) >= 3) { // laam++; zeit1++; speedb++; speedc++; maintime = millis(); colorw +=1; if (speedb >300) {speedb=0; } } while ((millis()- maintime2) >= 1000) { standbyblitz(); uhrzeit+=1; if (uhrzeit > 86400) {uhrzeit=0; runday++;} posdraw++; if (posdraw>(graphwidth-1)) {posdraw=0;} if (ccount2a ==1) {ccount2-=2;} if (ccount2a ==0) {ccount2+=2;} if (ccount2>120){ccount2a=1;} if (ccount2<=2){ccount2a=0;} graphdraw(); maintime2 = millis(); } while ((millis()- maintime3) >= 100) { //messignal der 4x 1A Li-po lademodule wenn geladen if (digitalRead(opto4) == HIGH) {ladevollblink++;} if (digitalRead(opto4) == LOW) { ladevollblink=0;} if (ladevollblink==0) { digitalWrite(blau,LOW); digitalWrite(rot,LOW);digitalWrite(grun,LOW);digitalWrite(UV,LOW);} if (ladevollblink==1) { digitalWrite(blau,HIGH);} if (ladevollblink==2) { digitalWrite(rot,HIGH);} if (ladevollblink==3) { digitalWrite(rot,LOW);} if (ladevollblink==4) { digitalWrite(blau,LOW);} if (ladevollblink> 10) { ladevollblink=0;} if (LCDLEDbrightc == 0) { digitalWrite(lcdback, HIGH); } if (LCDLEDbrightc == 1) { digitalWrite(lcdback, LOW); } LCDLEDbrightc++; if (LCDLEDbrightc > (61-LCDLEDbright)) {LCDLEDbrightc=0;} maintime3 = millis(); } } void standbyblitz(void) { if (digitalRead(opto4) == LOW && standbytrig >=1) { if ((uhrzeit%(standbytrig+1))==0) {digitalWrite(blau,HIGH);} if ((uhrzeit%(standbytrig+2))==0) {digitalWrite(rot,HIGH);} if ((uhrzeit%(standbytrig+3))==0) {digitalWrite(grun,HIGH);} if ((uhrzeit%(standbytrig+4))==0) {digitalWrite(UV,HIGH);} } } int slowg=0; void mospower(void) { int8_t ony =0; while (digitalRead(tast) == HIGH) { brightz =254; if (ony==0) {puffs++; ony=1;} digitalWrite(blau,HIGH); while ((micros()- mosz) >= 2) { for (int16_t msss = 0; msss < mss; msss++){ for (int16_t oss = 0; oss < 120; oss++){ if (oss load) {mosfets0;} }}} } mosfets0; mosz= micros();} }} int16_t uhrx=40; int16_t uhry=92; String info = " MEOW Its marderhcen's 700W 0-417kHz CATZ-VAPE Oszilator Prototype =^.^= MEOW! Intrigents=> 5x IRF3205 110.000mA Mosfet => STM32F102C9T6 72Mhz 128kB FLASH 20kB RAM => 6x Li-Po 2000mAh 15C 1x Li-Po 2200mAh 8C 14.200mAh Akkupower Cells ratet permanent POWERoutput ~700Watt ==> LEDs 1Watt RED, 1Watt GREEN, 1 Watt BLUE, 3Watt 420nm UV, 8x WS2812, 5x WS2812b ==> BOARsupply (USB OUT bottom: 5V 4000mA ==> Charge eating up to 6.000mA on 5V (USB port side) ==> DISPLAY ILI9341 2.8' 320x240px SPI ==> FERRIT core: 4x 1mm² 6turns ==> SAVETY stuff: 3x Themperature sniffer against overheating, 4x optokoppler vor meassure savly voltages, 5V supply powercuttswitch botton near USB PORT, Li-Po cells cased in glassfibre coated plastic case and connected with silicon FLEX wires to rest, Acryl laque agains watererrors, 18Ohm Gate discharge resistor fopr every MOSFET, FERRIT COIL also emergency shortcut HIGH preformence Resistor MEW! Ian like RAINBOWs so ITs slafhing colors for standby or errors, or battery chargestates *PURRRRRR* build with ebay Articles from china :: CODE,ELECTRIC,CIRCUITS,IDEA,MECHANICS, DEVELOPED from MARDERCHEN, if you finde something usefull in mess documentation just use it or parts =^.^= *SOL* ::, MEOW! speaker with BD237 on pin ==> =^.^= find code / pictures / stuff somewhere on http://marderchen.de "; int32_t startpos=0; int32_t letter=0; int32_t stringlang= info.length(); int8_t rainback=1; void wuselbild() { if (ccount1a ==1) {ccount1--;} if (ccount1a ==0) {ccount1++;} if (ccount1>96){ccount1a=1;} if (ccount1<=3){ccount1a=0;} tft.fillRect(0,2,239,8,BLACK); //learned this from MAX7219 library example (and motivied it a little) thanks colory(rainbow[ccount1+colorplus]); tft.setTextSize(1); tft.setCursor(0,2); for (int8_t linepos = 0; linepos < 40; linepos++) { letter=startpos+linepos; if (letter > stringlang) {letter -=stringlang;} if ((letter%128)==0) {rainback++; if (rainback>=2) {rainback =0;}} if (rainback==1) {colory(rainbow[letter%128]);} if (rainback==0) {colory(rainbow[128-(letter%128)]);} tft.setTextColor(tft.color565(r,g,b)); tft.print(info[letter]);} if (startpos++ >=stringlang){startpos=0; } tft.drawFastHLine(0,0,240,tft.color565(r,g,b)); tft.drawFastHLine(0,11,240,tft.color565(r,g,b)); //load power colory(rainbow[ccount1+colorplus*2]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(0,17); tft.print("load\ntime:"); tft.setTextSize(2); tft.setCursor(34,17); if (load <=9) {tft.print(" ");} if (load <=99) {tft.print(" ");} tft.print(load); tft.print("/120"); // often den load colory(rainbow[ccount1+ colorplus*4]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(120,17); tft.print("loads"); tft.setCursor(120,25); tft.print("often:"); tft.setTextSize(2); tft.setCursor(154,17); if (often <=9) {tft.print(" ");} if (often <=99) {tft.print(" ");} tft.print(often); tft.print("/120"); //often den often colory(rainbow[ccount1+ colorplus*5]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(0,59); tft.print("oft in\nmicros:"); tft.setTextSize(2); tft.setCursor(34,60); if (mss <=9) {tft.print(" ");} if (mss <=99) {tft.print(" ");} tft.print(mss); tft.print("/120"); // LCD LED BCKLIGHT colory(rainbow[ccount1+ colorplus*6]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(122,59); tft.print("LED-back."); colory(0x00aa00); tft.drawFastHLine(180,65,60, tft.color565(r,g,b)); colory(0x00FF00); tft.fillRect(180,59,LCDLEDbright-1,4, tft.color565(r,g,b)); // Alarmtemp colory(rainbow[ccount1+ colorplus*7]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(122,69); tft.print("ERROR-temp: "); colory(0xff0000); tft.setTextColor(tft.color565(r,g,b)); if (errortemp <=9) { tft.print(" ");} if (errortemp <=99) { tft.print(" ");} tft.print(errortemp); // Alarmweck colory(rainbow[ccount1+ colorplus*8]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(1); tft.setCursor(122,79); tft.print("Weck-ZEIT : "); colory(0xff0000); tft.setTextColor(tft.color565(r,g,b)); if ((alarmtime/60) <=9) { tft.print("0");} tft.print(alarmtime/60); tft.print(":"); if ((alarmtime%60) <=9) { tft.print("0");} tft.print(alarmtime%60); tft.print(" "); tft.setTextColor(DARKGREEN); tft.print(standbytrig); // Uhrzeit colory(rainbow[ccount2]); tft.setTextColor(tft.color565(r,g,b)); tft.setTextSize(5); tft.setCursor(uhrx,uhry); if (((uhrzeit/60)/60) <=9) { tft.print("0");} tft.print(((uhrzeit/60)/60)); tft.setCursor(uhrx+50,uhry); if ((uhrzeit%2)==0){ tft.print(":");} if ((uhrzeit%2)==1){ tft.print(" ");} tft.setCursor(uhrx+70,uhry); if (((uhrzeit/60)%60) <=9) { tft.print("0");} tft.print(((uhrzeit/60)%60)); tft.setCursor(uhrx+120,uhry); if ((uhrzeit%2)==0){ tft.print(":");} if ((uhrzeit%2)==1){ tft.print(" ");} tft.setCursor(uhrx+140,uhry); if ((uhrzeit%60) <=9) { tft.print("0");} tft.print((uhrzeit%60)); // wuselrect(6,15,200,150,2,3,true); } int rainbowcolor =0; int rainbowcolor2 =0; int rant=0; //my rainbow chaotic drawingstuff void wuselfillrect(int16_t eckex, int16_t eckey,int16_t breit, int16_t hoch,uint8_t colorspeed, int8_t chaos, boolean colormove) { for( int rx = eckex; rx < (eckex+breit); rx++) { wuselline(rx,eckey,rx+breit,eckey+hoch,colorspeed,chaos,colormove); } } void wuselrect(int16_t eckex,int16_t eckey, int16_t breit, int16_t hoch,uint32_t colorspeed, int8_t chaos, boolean colormove) { rant+=random(4,6);; if (rant >=128){rant=0;} rainbowcolor2=rant; wuselline(eckex,eckey,eckex+breit,eckey,colorspeed,chaos,colormove); wuselline(eckex+breit,eckey,eckex+breit,eckey+hoch,colorspeed,chaos,colormove); wuselline(eckex+breit,eckey+hoch,eckex,eckey+hoch,colorspeed,chaos,colormove); wuselline(eckex,eckey+hoch,eckex,eckey,colorspeed,chaos,colormove); } int slower =0; //Bresenham's algorithm - thx wikpedia (and adafruit) but the marderchenmod void wuselline(int16_t x0, int16_t y0,int16_t x1, int16_t y1,uint32_t colorspeed, int8_t chaos, boolean colormove) { //if colormove =false, colorspeed = color ( 0xFF205B etc.) int16_t steep = abs(y1 - y0) > abs(x1 - x0); if (steep) { swap(x0, y0); swap(x1, y1); } if (x0 > x1) { swap(x0, x1); swap(y0, y1); } int16_t dx, dy; dx = x1 - x0; dy = abs(y1 - y0); int16_t x10=x0; int16_t err = dx / 2; int16_t err2 = dx / 2; int y10 =y0; int16_t ystep; if (y0 < y1) { ystep = 1; } else { ystep = -1; } for (; x0<=x1; x0++) { if (steep) { // if (colormove == true) { colory(rainbow[rainbowcolor2]); tft.drawPixel(y0, x0, tft.color565(r,g,b));} // if (colormove == false) { colory(colorspeed); tft.drawPixel(y0, x0,tft.color565(r,g,b));} } else { // if (colormove == true) { colory(rainbow[rainbowcolor2]); tft.drawPixel(x0, y0, tft.color565(r,g,b));} // if (colormove == false) { colory(colorspeed); tft.drawPixel(x0, y0, tft.color565(r,g,b));} } err -= dy; if (err < 0) { y0 += ystep; err += dx; } } for (; x10<=x1; x10++) { //rainbowcolor2 +=colorspeed; rainbowcolor2 +=colorspeed; slower++; // if (slower >=10) {rainbowcolor2 +=colorspeed; slower=0;} // if (rainbowcolor >= (128-colorspeed)) { rainbowcolor =1;} if (rainbowcolor2 >= (128-colorspeed)) { rainbowcolor2 =1;} if (steep) { if (colormove == true) {colory(rainbow[rainbowcolor2]); tft.drawPixel(y10+random(-chaos,chaos),x10+random(-chaos,chaos), tft.color565(r,g,b)); } // if (colormove == false) { colory(colorspeed); tft.drawPixel(y10+random(-chaos,chaos),x10+random(-chaos,chaos), tft.color565(r,g,b)); } } else { if (colormove == true) {colory(rainbow[rainbowcolor2]); tft.drawPixel(x10+random(-chaos,chaos),y10+random(-chaos,chaos), tft.color565(r,g,b));} // if (colormove == false) {colory(colorspeed); tft.drawPixel(x10+random(-chaos,chaos),y10+random(-chaos,chaos),tft.color565(r,g,b));} } err2 -= dy; if (err2 < 0) { y10 += ystep; err2 += dx; } } } int colorIndex =0; void WS2812rainbow() { if (brightz >(LCDLEDbright*4+3)){brightz -=2;} if (colorw > 500) {colorw=0;} colorIndex = colorw; for( int iy = 0; iy < screeny; iy++) { colorIndex+=20; //leds[iy] = rainbow[round(colorw)]; leds[iy] = ColorFromPalette( currentPalette, colorIndex, brightz, currentBlending); } FastLED.show(); FastLED.delay(1000 / 5000); } int startx =50; int starty=14; int once =0; int c1 =0; int8_t menu = 0; int8_t zeitz=0; int dist =45; int infh =80; int colori=0; void wuselRGBrec(int16_t eckex,int16_t eckey,int16_t breit,int16_t hoch) { for( int rx = eckex; rx < (eckex+breit); rx++) { colory(rainbow[round(128-(rx-eckex)*0.58)]); tft.drawFastVLine(rx,eckey,hoch,tft.color565(r,g,b)); } } void colory(uint32_t colorz) { String hexcolor = String(colorz); int number = hexcolor.toInt(); r = number >> 16; g = number >> 8 & 0xFF; b = number & 0xFF; } /* MEOW build power li-po caused 3dal walkingtravel next week and wouldn permanently charge vape ..working fine now upgrading code * by marderchen =^.^= currently working awesome *ITs free! ( copy parts or use it in any kind if its usefull for you ) * ___ * _.-| | / |\__/,| (`\ { | | -- |^ ^ |__ _) ) "-.|___| \ _.( Y ) ` / .--'-`-. _((_ `^--' /__< \ ....-+|______|__.-||__)`-' (((/ (((/ CATS are awesome! */