FastLED 3.9.15
Loading...
Searching...
No Matches

◆ loop()

void loop ( )

Definition at line 764 of file curr.h.

764 {
765
766 delay(4);
767 uint32_t now = millis();
768 frameBufferPtr->clear();
769
770 if (allWhite) {
771 CRGB whiteColor = CRGB(8, 8, 8);
772 for (u32 x = 0; x < frameBufferPtr->width(); x++) {
773 for (u32 y = 0; y < frameBufferPtr->height(); y++) {
774 frameBufferPtr->at(x, y) = whiteColor;
775 }
776 }
777 }
778
779
780 // Update the corkscrew mapping with auto-advance or manual position control
781 float combinedPosition = get_position(now);
782 float pos = combinedPosition * (corkscrew.size() - 1);
783
784
785 if (renderModeDropdown.value() == "Noise") {
786 drawNoise(now);
787 } else if (renderModeDropdown.value() == "Fire") {
788 drawFire(now);
789 } else if (renderModeDropdown.value() == "Wave") {
790
791 drawWave(now);
792 } else if (renderModeDropdown.value() == "Animartrix") {
793 drawAnimartrix(now);
794 } else {
795 draw(pos);
796 }
797
798
799 // Use the new readFrom workflow:
800 // 1. Read directly from the frameBuffer Grid into the corkscrew's internal buffer
801 // use_multi_sampling = true will use multi-sampling to sample from the source grid,
802 // this will give a little bit better accuracy and the screenmap will be more accurate.
803 const bool use_multi_sampling = splatRendering;
804 // corkscrew.readFrom(frameBuffer, use_multi_sampling);
805 corkscrew.draw(use_multi_sampling);
806
807 // The corkscrew's buffer is now populated and FastLED will display it directly
808
809 FastLED.setBrightness(brightness.value());
810 FastLED.show();
811}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint8_t pos
Definition Blur.ino:11
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74
UISlider brightness("Brightness", 128, 0, 255, 1)
FL_OPTIMIZATION_LEVEL_O0_BEGIN float get_position(uint32_t now)
Definition curr.h:425
void draw(float pos)
Definition curr.h:538
void drawWave(uint32_t now)
Definition curr.h:717
UIDropdown renderModeDropdown("Render Mode", renderModeOptions)
void drawNoise(uint32_t now)
Definition curr.h:533
void drawAnimartrix(uint32_t now)
Definition curr.h:748
fl::shared_ptr< Grid< CRGB > > frameBufferPtr
Definition curr.h:291
void drawFire(uint32_t now)
Definition curr.h:651
Corkscrew corkscrew(CORKSCREW_TURNS, NUM_LEDS)
UICheckbox splatRendering("Splat Rendering", true)
UICheckbox allWhite("All White", false)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

References allWhite(), brightness(), corkscrew(), draw(), drawAnimartrix(), drawFire(), drawNoise(), drawWave(), FastLED, frameBufferPtr, get_position(), pos, renderModeDropdown(), splatRendering(), x, and y.

+ Here is the call graph for this function: