// using my WS2812Bmiowmeter.. but want new code so here it is // 120x WS2812B stipe 60/m used vertical, Din =floor on STM32F103C8T6 PB8 (no other GPIOs used) (old board) power 5V (2Asupply +heatsink+capacitors) //aditional 10V 33uF capacitor soldered on stripe end 5V + ground for more efficience.. //programm for slowly running fading a ws2812b stripe in random color have fun use it if usefull :3 //finaly idea created ws2812B stripe tetrisanimation.. //random color pixel fall down... fall downpixel mix storring on ground.. //is similar pixal fall on same startflickering all pixels similar in mix also flickering and gone.. //mix fall together 2same colors together flickering again and all same colors gone.. continiues :3 //stripe full with bad chaos mix until 20leds left.. all flickering and gone.. //mix fall together 2 pixels near same again flickering.. nice game starting create a code //code and idea by marderchen :3 a realy complex logic stripegameanimation justuse this if like it hate capitalism! #include #define screeny 119 //enter number of leds you have in the stripe here rest is flexible (think 255maximum caused have used some uint8_t variables chane to uint16_t for using more leds CRGBPalette16 currentPalette; CRGB leds[screeny+2]; #define user PC13 //onboardled running indicator void setup(){ pinMode(user,OUTPUT); FastLED.addLeds(leds, screeny); FastLED.setBrightness(255); currentPalette = RainbowColors_p; delay(100); //wait for full power } int16_t merkd,positron,timer[11]; uint16_t timernewpix,rander,nexter,hellmax=255,mengec; uint8_t leddata[screeny+2][2];//(color,brighteness) int16_t gamedata[screeny+2][10];//0active,1falingnoned,2timer,3intervall,4color,5position,6flicker,7hell,8flickertick void loop(){zeitreise();} long maintime=millis();long littletime=micros();long slowtime=millis(); void zeitreise(void){ while ((millis()- maintime) >= 2){maintime=millis();merkd++;if(merkd>20){merkd=0;}if(merkd<10){digitalWrite(user,LOW);}else{digitalWrite(user,HIGH);} timernewpix++; for(uint8_t timergibt=0; timergibt<=screeny; timergibt++){if(gamedata[timergibt][0]==1){gamedata[timergibt][2]++;}} wuselfarben(); maintime=millis();}//indicator while ((millis()- slowtime) >= 2){for(uint8_t da=0;da<=screeny;da++){if(leddata[da][1]>0){leddata[da][1]--;}if(leddata[da][1]>1){leddata[da][1]-=2;}}slowtime = millis();} //fadedown while ((micros()- littletime) >= 2000){for( int y = 0; y <=screeny; y++) {leds[y] = ColorFromPalette( currentPalette,leddata[y][0]*21,leddata[y][1],BLEND);}FastLED.show();littletime = micros();} //apply array } void wuselfarben(void){ if(timernewpix>=rander){timernewpix=0; rander=random(20,30)*10; if(leddata[screeny-1][1]<10){gamedata[nexter][0]=1;gamedata[nexter][3]=random(1,6)*3;gamedata[nexter][4]=random(0,12);gamedata[nexter][5]=screeny; gamedata[nexter][7]=hellmax;}}//setse startwert mengec=0; for(uint16_t gug=0;gug=gamedata[gug][3]){gamedata[gug][2]=0; //interfallticker if(gamedata[gug][5]>0){if(leddata[gamedata[gug][5]-1][1]==0){gamedata[gug][5]--;}}//fallrunter wen nächster schwarz } leddata[gamedata[gug][5]][0]=gamedata[gug][4]; if(gamedata[gug][7]>0){leddata[gamedata[gug][5]][1]=gamedata[gug][7];}//überneme gamedata an position if(leddata[gamedata[gug][5]][0]==leddata[gamedata[gug][5]-1][0]){gamedata[gug][6]=1;gamedata[gug][3]=9;//erkenne doppelfarbe setz gleich flacker // for(uint8_t alle=0;alle20){for(uint8_t ww=0;ww<9;ww++){gamedata[gug][ww]=0;}}//wegmach mengec++;// zähl aktive if(mengec >(screeny-20)){for(uint8_t jeder=0;jeder