// Create a function to display the beating heart frames void animatedHeart() { FastLED.clear(); //Clear the LED Array //A heart displays and beats across the Laser Stems for (int i = 0; i < NUM_LEDS; i++){ // Cycle through each LED on the matrix if (frame == false) { // If the small frame is next, load it into leds[] if (heart_small[i] == 1) { leds[i] += CRGB::Red; } } else { // Else, if the large frame is next, load it into leds[] if (heart_large[i] == 1) { leds[i] += CRGB::Red; } } } delay(400); frame = !frame; // Alternate between frames }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter