![]() It basically fills the whole strip and unfills it again. The panel will hopefully combine running lights (dimmed red), brake lights (bright red) and turn signals (sweeping orange) which is what the Knight Rider effect is for.īefore I saw your last post, I found and slightly adapted another code which I found here: Since I'm so new to coding, I really need to understand the fundamentals of each of the examples I've seen at it's most basic!. I'm trying to put together a panel of leds (consisting of 10 strips high 圆00mm long) which will replace the brake lights on my 68 Mustang. Now that I've got this far, I can start to specify what I'm trying to achieve a little more. I can't thank you enough for your time and I really appreciate the encouragement. The links you sent were great and the code you sent also did exactly what I was after. Thanks so much for the in depth reply and sorry for my late one! My favorite project of hers is her DotStar Belly Dance Fans project which is located here: Good places to learn more about code are:Īnd of course reading the various posts in this forum.įYI, Erin St Blaine has posted a number of outstanding projects in the learn section of the Adafruit website using the FastLED library for her code. You can learn how to change the color in the code on the following webpage by looking at the very bottom of the webpage for various colors to use: Also, I included a modified sinelon () function. I modified the functions so that you can change the rate and the color of the moving pixel. It was compiled using the Arduino IDE 1.6.9 and the 3.1.1 FastLED library. It was tested successfully on some NeoPixels using an Arduino Uno. Uint8_t pos = beatsin16(BPM,0,NUM_LEDS) //BPM will allow you to adjust the speed the dot is moving. a colored dot sweeping back and forth, with fading tailįadeToBlackBy( leds, NUM_LEDS, 20) //change 20 to smaller or larger number to adjust the length of the tail. Void cd77_sinelon(uint8_t BPM, CRGB color ) Uint8_t u= beat8(BPM,0) //BPM will allow you to adjust the speed the dot is moving. a colored dot going in one direction with fading tailįadeToBlackBy( leds, NUM_LEDS, 10) //change 10 to smaller or larger number to adjust the length of the tail. Void cd77_sinelon_oneway(uint8_t BPM, CRGB color) #define BRIGHTEST 40 // the BRIGHTEST range is from 0 to 255.įastLED.addLeds(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ) // uncomment ",GRB" if you use the WS2812B chipset. #define chipset NEOPIXEL //use WS2812B if not using NEOPIXEL products. Goes either back and forth with a tail or goes only forward with a tail. Based on the DemoReel100 example of the FastLED library. This is just the start of what I'm trying to achieve but it is also the most complex part.Ĭode: Select all // Knight Rider Type Patterns by Chemdoc77 ![]() If anyone has the time to take the above code and create an exmaple for me, I would be extremely greatful! I'm also not sure how or exactly where to introduce a map() function into this but I'm going to do some reading now. It must be frustrating for you guys (whoever's reading this anyway) that I'm trying to jump into the deep end without knowing much at all about coding but these examples are helping me get my head round things. I also tried removing the reference to sinelon and replacing with loop but I get the same result. Is there any more I can strip out considering I only want one function, not a cycling set? I have tried to remove more and it successfully sends to the Arduino but the leds don't react. a colored dot sweeping back and forth, with fading trails #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A))) insert a delay to keep the framerate modest send the 'leds' array out to the actual LED strip Call the current pattern function once, updating the 'leds' array Uint8_t gHue = 0 // rotating "base color" used by many of the patterns Uint8_t gCurrentPatternNumber = 0 // Index number of which pattern is current Old_val = dimColor(old_val, width) įor (int count = NUM_PIXELS-1 count>=0 count-) ![]() My problem is that I can't work out which portion of this code creates the trail and this code has more functions than I need I think. I'd like to add a trail much like this one: clear our current dot before we move on tell FastLED there's 60 NEOPIXEL leds on pin 4įastLED.addLeds(leds, NUM_LEDS_PER_STRIP) just addLeds multiple times, once for each strip For mirroring strips, all the "special" stuff happens just in setup. different pins, and show the same thing on all four of them, a simple bouncing dot/cyclon type pattern In this example, we're going to set up four NEOPIXEL strips on four Code: Select all // MirroringSample - see for more info on
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |