07-Bounce Effect - LED Strip Arduino Tutorial - FastLED Effects - on RGB LED WS2812B and Neopixels

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 104

  • @TheJustinist
    @TheJustinist 3 роки тому +24

    I came for the Task Manager videos, but im stayin for the RGB. Love how you show your effects using a keyed background so we just see the effects.

  • @alanesq1
    @alanesq1 2 роки тому +6

    Thanks for sharing. Despite my having many years experience (strictly as an amateur) with Arduinos/ESPs there is an awful lot I am going to learn from studying this as it is on a very different level to what I am used to.

  • @pegr69
    @pegr69 3 роки тому +3

    Awesome work Dave, being an old Java developer I found this really interesting in order to learn C++. Best way learn is to get instant feedback. Cheers from Sweden.

  • @rov.3358
    @rov.3358 3 роки тому +2

    If someone is wondering when use mirror balls and the last led stays white it is just a matter of two = in the first two for loops before _cLength signs in the virtual void Draw() function.. just set i

    • @danman32
      @danman32 2 роки тому

      Thanks for the fix.
      To clarify, the problem is in the for loop that processes the fadee.
      Change for (size_t i = 0; i < _cLength; i++) to for (size_t i = 0; i

    • @SomerledDesign
      @SomerledDesign 2 роки тому +1

      Thank you. That was helpful.

    • @hubba002123
      @hubba002123 Рік тому

      Thank you! I ran into the same issue. I thought it was because the BouncingBallEffect constructor had _cLength(cLength-1). I changed it to _cLength(cLength) and no more white LED at the end of my strand. I'm not a C++ programmer, but that worked.

  • @chrislamb4723
    @chrislamb4723 3 роки тому +2

    For me, and I hope others, this is a fantastic way to learn programming... your explanations during writing along with instant visual results are a great help to understanding languages (pural because I really like how you identified differences between c and C++, such as the dynamic array aspect of C++, which I did not know about (my background is hardware and I want to greatly strengthen my software background - your vids have been doing just that!). Thank you for this outstanding content and series!

  • @audiohead2406
    @audiohead2406 3 роки тому +3

    Dave, you're awesome!!! Thank you for what you're doing with your time and for helping the advancement of others on this subject.

  • @mikus4242
    @mikus4242 3 роки тому +2

    Really enjoying the series. Thanks.

  • @LeeNoverEx
    @LeeNoverEx 4 роки тому +3

    Nicely explained and shown. I do prefer using a check if enough time has elapsed instead of a delay(), eg. if (millis() - lastUpdate < minUpdateInterval) return; // at start of function

    • @DavesGarage
      @DavesGarage  3 роки тому +2

      I agree. I didn't want to complicate it yet, but normally I have the effect code return it's desired delay and the calling loop figure out how to spend that time... but will introduce that later!

  • @lmstrutt
    @lmstrutt Рік тому +1

    Wow, this one is a lot more complicated. I preferred that, when the balls were "kicked" back up, they would go all the way to the end of the strip. So, in bounce.h, I changed the kick code to if (BallSpeed[i] < 0.01) BallSpeed[i] = InitialBallSpeed(StartHeight); Great video!

  • @aleksandrofarias9131
    @aleksandrofarias9131 3 роки тому +1

    I myself do not understand what you say but I see the videos and what I see the effects are beautiful is to be congratulated 😍

  • @michaegi4717
    @michaegi4717 3 роки тому +2

    I just found this nice video. I din't know this channel. Thank you for this detail video. I'll definetley visit more videos of this channel.

  • @guiltypleasure268
    @guiltypleasure268 4 роки тому +2

    Another great video! Thank you Dave.

  • @jstreet421
    @jstreet421 4 роки тому +2

    Dave great videos.. I had to get started playing with LEDs and the arduino can't wait to see the fire one and id love to see a video of the truck led brake turn and backup in the intro video

  • @egosumalpha6325
    @egosumalpha6325 2 роки тому

    thx! I am implementing your lessons on a 16x16 LED matrix. Great way to get an introduction to the C++ programming language whilst making some cool stuff.

  • @blue1c3
    @blue1c3 2 роки тому

    I'm starting coding as a new hobby and your instructional videos really are interesting. I can't wait to get my hands on with esp32 soon. Thanks.

  • @tattoomafew2316
    @tattoomafew2316 Рік тому

    Changes I made to the bouncing ball effect:
    I made speedKnob a parameter in the draw function to pass music amplitude values from a sound sensor.
    Removed _fadeRate and changed the persistence code to:
    for (size_t i = 0; i < FastLED.size(); i++)
    {
    FastLED.leds()[i].fadeToBlackBy((1 / speedKnob) * _cBalls * FastLED.size());
    }
    The amplitude values passed to speedKnob are mapped between 4.0 and 8.0

  • @paulbaird1351
    @paulbaird1351 2 роки тому +1

    Dave, the way you explain the importance of every code and commands in relation to other systems and resources really leads me to believe I've not begun learning coding in the most optimized manner. I am relatively new to programming, but clear in your method of thinking is a mode of understanding that I think I can relate to. I would be eager to know if you have any books, or set of resources you could recommend that helped you to achieve such clarity on the topic? Thanks

  • @michaegi4717
    @michaegi4717 3 роки тому +1

    I was playing arround for the first time with FastLED, while I watch this video. I was a concerned when you say that I should limit the power to 300mw if using USB port of my pc. At that moment I draw 900mw from my PC... but a quick research said: normal USB-Spec is up to 500mA so 2500mW. The 900mw sould be well in spec, or did I messed up my math.
    Nevertheless this power limit-option might save my USB-Port from melting in the future, thats essential.

  • @OldePhart
    @OldePhart 3 роки тому +2

    Is Carl out on sabbatical? Loved that guy !

  • @saran9407
    @saran9407 2 роки тому

    Great series Dave 👏

  • @doverwilliams5861
    @doverwilliams5861 3 роки тому

    Hi Dave, still loving the series. One observation I will share on how I learn. Around the 22:22 mark where you discuss making the colors additive. I had jumped the gun before that change and compiled and uploaded the code to my board. I found it beneficial to first observe the behavior before modification then see the effect you describe after making the colors additive. Looking forward to the next episode. Thanks.

    • @DavesGarage
      @DavesGarage  3 роки тому +1

      Good point, thanks! And so in the episode I'm editing right now (helper macros episode) I mess up the use of color in let it go it shows up on the LEDs, then fix it, so you see both like you are saying. If the bug looks interesting or educational at all, I'll let it go! I just have to consider whether to let the audience in on it ahead of time (in post) so they don't get led astray? It's hard to unlean stuff if you get shown the wrong way the first time!

    • @doverwilliams5861
      @doverwilliams5861 3 роки тому

      @@DavesGarage I understand your logic and it makes since not to confuse your audience if you judge that there is little educational value to be gained. Just wanted to share my experience because I truly appreciate the effort you put into each of these episodes.

  • @RicardoPenders
    @RicardoPenders 4 роки тому +2

    Thanks for sharing Dave, you've got my like and I subscribed.

    • @DavesGarage
      @DavesGarage  4 роки тому +2

      Thanks!

    • @RicardoPenders
      @RicardoPenders 4 роки тому

      @@DavesGarage I really love the way you explain things especially these Arduino series. I hope to see some more of that in the future from you doing all kinds of things with an Arduino.

  • @johnburgess2084
    @johnburgess2084 Рік тому

    You said, "Give me at least one of each (subs and likes)." Would if I could, but the limit is 1 each! Thanks for the fun, educational series.

  • @RNMSC
    @RNMSC 2 роки тому

    I keep remembering my idea of the ARC reactor module startup in Iron Man, where it looked like the ring of light started with 3 different 'balls' of energy, flowing in either direction. Every time 2 balls 'collide' (from opposite directions) the brightness of those two balls goes up. Every time all 3 balls end up together, brightness doubles, and I would imagine that one could play with velocity and slow down the fade down of the tail. At some point the whole ring ends up being full brightness, though you could do other effects, such as now rotate the three color balls in the same direction for a while with varying speeds, leaving the ring white and turn off the color for each of the balls at their original speed and directions, etc.
    Again, that was my impression of what the arc reactor startup was doing, though the instantiation in the movie was far higher resolution than a 32 or 256 pixel ring, and was pretty much CG animation in any case, but I keep thinking that it should be easy enough to do. (My idea being to use 3 prime numbers to maximize the time before a 3 way intersection, and possibly include a fade down of the original intensity of the balls until they bump into each other.
    OK, something to puzzle out when I get time. I think I have some of that coming up.. soon?

  • @jasonmanswimmer23
    @jasonmanswimmer23 3 роки тому +4

    Great tutorial, unfortunately I cannot use sys/time.h in windows. Everything I've seen is kind of sending me in circles.

  • @dalewolver8739
    @dalewolver8739 2 роки тому

    Thanks Dave. That was brilliant...

  • @niczoom
    @niczoom 3 роки тому

    Brilliant video! Im definitely gonna have to brush up on C++, I can follow what you're doing but I'm no C++ programmer, that's for sure. Great work.

  • @GodSpeaksInMath
    @GodSpeaksInMath 3 роки тому

    Ive created some devices using 2812 strips but with the Arduino Neopixel library and some buggy freestyle/glue code...Ive had issues esp when I went to dual core implementation on the ESP32 where i used one core to handle webserver and other to handle lights etc.. I get weird effects, esp on the first LED...thanks for the insights and I'll definitely give FastLED another try.. also too bad the creator passed away but at least his code will live on.

  • @muhammadfarooq983
    @muhammadfarooq983 3 роки тому +1

    Loved it man!

  • @MatSmithLondon
    @MatSmithLondon 3 роки тому +1

    Does FastLED support RGBW strips yet, e.g. the SK6812? Love this channel after having discovered it from the Task Manager video!

  • @Sully365
    @Sully365 Рік тому

    dangit...had to sub and like. who could turn that down. thanks for this effect, just got my led strip with no clue where to start :)

  • @bwo924
    @bwo924 Рік тому

    I tried adding in the power limiter and milliwatt display to an existing project and I definitely got the limiter working but I keep getting error codes for the display portion

  • @ronaldhofman1726
    @ronaldhofman1726 2 роки тому

    hi Dave , nice learning video,, i wil order led strip and start playing with it.

  • @josephcarbungco3548
    @josephcarbungco3548 3 роки тому

    cool .. thanks always for sharing your ideas, very creative and truly an pioneer in CODES.

  • @coreypeterson513
    @coreypeterson513 2 роки тому

    Dave thanks for all these awesome examples. I get to this one and got stuck. I am using Arduino and don't have sys/time or vector. I am new and don't know what to do. 😯

  • @vhm14u2c
    @vhm14u2c 2 роки тому

    Dave, thanks for mentioning this is the code that’s running on the atomic desk lamp behind you. I was wondering how you done that effect.🥂

  • @autodidact7127
    @autodidact7127 4 роки тому +2

    Thank you Dave! I love this. Got my ESP 32 and trying to find a controller thats suitable in my kit.

    • @DavesGarage
      @DavesGarage  4 роки тому +3

      What do you mean by 'controller'? An ESP32 module and an LED strip should be all you need (plus a USB cable), normally.

    • @autodidact7127
      @autodidact7127 4 роки тому +1

      @@DavesGarage really? I thought I needed a driver that could push the power. As you covered in the video you can program it to limit power but hey I feel stupid now. I bought several esp32s I use one to host a webserver to listen for commands from webhooks linked to my home automation system to turn on one of those aroma misters and set the led color using 2 transistors. This is my first foray into addressable LEDs. My stupidity is endless 😂

  • @danwalther4782
    @danwalther4782 Рік тому

    Thanks for your videos. I've really been enjoying following along and learning how to make sweet light effects. It's been great!
    Ran into a wall on this vid though, seeing as I'm trying to follow along on windows and haven't been able to reconcile the gettimeofday command even after all the searching the interwebs I've done.
    Any suggestions on what I can try or where I can look?

  • @paulbaird1351
    @paulbaird1351 2 роки тому

    Epic!!!

  • @qwer.ty.
    @qwer.ty. 4 роки тому +1

    Are you the guy with the wsb2812b led on your GMC truck ?
    Awesome vid, I was so scared of FastLed at first glance...

    • @DavesGarage
      @DavesGarage  4 роки тому +2

      That's me! And that is also FastLED! Hope this video makes FastLED more approachable for you!

    • @qwer.ty.
      @qwer.ty. 4 роки тому

      @@DavesGarage wow nice ! I don't remember your reddit post, but did you share your code on a repository ?

  • @Openroadadv
    @Openroadadv Рік тому

    Just curious but do you perhaps do custom work for individuals. I have a tractor trailer I’m working on and want more out of my current led system

  • @g.m4z956
    @g.m4z956 2 роки тому

    sys/time and vector aren't recognize in library on visualstudio windows. Any solution please? How to trasform the UnixTime funcion in a millis() funcion in the DrawFire?

  • @Jaredson
    @Jaredson 2 роки тому

    Love the content. Thank you

  • @sunrisewithsmile2820
    @sunrisewithsmile2820 2 роки тому

    hey Daves your aswome thanks for all explanation :)
    I start to work on the bounce effect, and I am little bit confused with the files in the github, the bounce effect is not working like in the video

  • @kentoowin
    @kentoowin 3 роки тому

    Ok ...I DO appreciate programmers.🥳🤪😆
    Thank all of you.
    🤜🤛
    I'd love to get this going soon too.
    I thought AC inspecting was hard.

  • @danman32
    @danman32 2 роки тому

    You're confusing watts (or mW) with amps. A USB 1.0, let alone 3.0 can handle up to 500mA @ 5V.
    That would be 2.5W or 2500mW. USB 3.0 can handle even more, up to 900mA for the strict standard specification, or 4.5W @ 5V or 4500mW. Many PC/laptop USB ports can be used for charging so can even deliver more A/W than specs.
    As I said in my recent comments in the first episode introducing WS2812B, there is an idle current that you need to consider.
    For me, a 300 LED strip consumes about 0.240A, including the microcontroller even when the LEDs are not lit. The controller chip in each LED draws anywhere from 0.5 to 1mA each which adds up when you have hundreds of LEDs. In my case, because of the brightness setting, lighting the LEDs for these effects tends to be less significant though not insignificant compared to the idle current.

  • @redrighthandarts
    @redrighthandarts Рік тому

    not all heros wear capes

  • @jhordyperez1594
    @jhordyperez1594 3 роки тому +4

    Hello my friend, excellent video, I have problems using the and libraries, I still don't know what the problem is but I can't use them in my code, there is some way to add it, I'm new to PlatformIO, :( :( :(

    • @reykoschachtschneider4645
      @reykoschachtschneider4645 3 роки тому +2

      Hi, have you found a solution? I have the same problem on a linux Ubuntu 20.04 system and cannot find a solution on the internet. But I'm new to VS Code and think, maybe my system is not set up properly...

    • @brendankp
      @brendankp 3 роки тому +1

      Second this question, it seems like the toolchain-atmelavr package doesn't include or can't find the sys/time.h or vector source files? Do I just need to add something to my include path? Anyone else had this issue and resolved it? @Dave's Garage

    • @chrislondal3462
      @chrislondal3462 3 роки тому +1

      @Dave's Garage I also have this problem and have been trying to figure it out for hours today. I've tried installing libraries and files but that hasn't worked. I don't know what I am doing wrong!

  • @FlasH5922
    @FlasH5922 4 роки тому +1

    Hi, Dave! Hm, why is your led strip consumes 9W? As I know every led takes 60 mA, that for 50 leds = 3000mA and power = 3000mA * 5V = 15000mW. This question also because my leds consumes less current than should and I don't know why :)

    • @DavesGarage
      @DavesGarage  3 роки тому +1

      static const uint8_t gRed_mW = 16 * 5; // 16mA @ 5v = 80mW
      static const uint8_t gGreen_mW = 11 * 5; // 11mA @ 5v = 55mW
      static const uint8_t gBlue_mW = 15 * 5; // 15mA @ 5v = 75mW
      static const uint8_t gDark_mW = 1 * 5; // 1mA @ 5v = 5mW
      If my calculator is right, that's 43mA per LED, or 215mW on a 5V strip. So for my 45 actual LEDs, I'd guess 9675 which is close to what it said!

  • @NunchakuFlowTutorials
    @NunchakuFlowTutorials 3 роки тому +1

    awesome video dave. i have a question for you how do you change the colour off the flame in flame 2012? iv been trying to find a video on this with no success. i did find this out you can edit the // sections above the void loop() to change colour. i think this make a good video and what else can you edit on the // side of thing because there's so many this would be awesome to hear your thoughts on this maybe in a upcoming video

    • @DavesGarage
      @DavesGarage  3 роки тому

      I have no idea, not sure what Flame2012 is, but I bet the mapping of the temperature to heat color is where you're looking for!

    • @NunchakuFlowTutorials
      @NunchakuFlowTutorials 3 роки тому

      @@DavesGarage fire 2012 is some of the pre built code in Arduino app there's lots of sections in there i don't understand i know how to change to colour as all colours are in GitHub but there's so many options

  • @SisterIdaKnow20
    @SisterIdaKnow20 Рік тому

    The text being SO blurry, several of the operations being typed cannot be read clearly. Most often, going to the github link for this episode has a completely different set of .cpp files.. (Confused and searching)

  • @dvohwinkel
    @dvohwinkel 4 роки тому +1

    Really great video. Is there a reason you used delay() and not FastLed.delay() ?

    • @DavesGarage
      @DavesGarage  4 роки тому +1

      Thanks! I don't really know if FastLED.delay() is compatible with ESP32 threads and tasks, so didn't want to add a dependency on it. I -think- the main thing it does is support dithering, which I'm not using. Is there anything I lose, do you think, by not using it?

    • @dvohwinkel
      @dvohwinkel 4 роки тому +1

      @@DavesGarage I think it just delays by calling fastLed.show() until the time has expired. So no real benefit for your use. I was just curious.

    • @czarekcz1097
      @czarekcz1097 3 роки тому

      I thought that FastLED.delay() is enabling interrupts at the entry to the procedure and disable interrupts at the exit. FastLED library has difficulty with proper interrupt service. In fact, it doesn't work under FreeRTOS (it use primitive bit bashing at the bottom, with timing delays based on software delays, preventing FreeRTOS operation). I guess if you are using delay then you are unable to use properly timed interrupt services. Correct me if I am wrong!

  • @Kagesh53150
    @Kagesh53150 3 роки тому

    Thanks for the lesson! I do notice that after the first bounce with a mirrored bounce, the last (64th) LED stays on. Anyone else notice this? Just trying to see if I made a typo?

  • @stevefox3763
    @stevefox3763 2 роки тому

    I have wled running on an ESP32 devkit board, I take it this code will run fine on those boards too?

  • @Rx7man
    @Rx7man 2 роки тому

    I did some similar stuff with a TLC5940 chip driving 5 RGB LED's.. I made various blinking lights, emergency vehicles of various patterns, fades, etc... My code is definitely not as concise as yours though!

  • @AlejandroGutierrez-Bit
    @AlejandroGutierrez-Bit 3 роки тому

    excelente!!

  • @kevinheinen
    @kevinheinen 3 роки тому

    G'day Dave, Thanks for the awesome videos..!!!! QUESTION: with the bouncing balls effect, if i remove the "infinite" While(true) loop and leave the "balls.Draw(); & FastLED.Show();" in void loop() the effect no longer runs, the balls just sit at the starting pixels....any hints to what i am missing?

  • @pauldandrea5504
    @pauldandrea5504 3 роки тому +1

    I've got sort of a basic question: I'm new to Arduino but not new to coding (although I'm rusty, I quit my day job a good few years ago) and the board I'm using is a Mega 2560. I don't seem to have access to sys/time.h and have done some Googling to figure out why. It looks like maybe the 2560 doesn't have the same support for time functions that the esp32 has, and that the Platformio environment adds libraries that your board has the hardware to support. No hardware support for time stuff means no imported sys/time.h Am I right about this?
    I bought a whole Arduino kit which included a DS1307 module. Can I use this to support the sys/time.h functions used in bounce.h?
    These videos have been fantastic, thanks for taking the time to put them together.

    • @glendaniel7971
      @glendaniel7971 3 роки тому +1

      im having the same issue with my Mega2560, i have a few already purchased to place around my yard. Dave is there any work around for us arduino uses for the sys/time.h , its seemingly too obscure for google. have found a few time libraries but they dont seem the same as the ESP built in one. if that makes sense

    • @pauldandrea5504
      @pauldandrea5504 3 роки тому +1

      @@glendaniel7971 I never did find an answer. The more I dug in the more I saw that it was multiple libraries that were missing, not just time.h, like libraries for vector and printf. I found libraries that worked, but not perfectly. Eventually I gave up and bought an esp32 and that solved all those issues. Thankfully I only have one mega2560, so $10 for an esp32 wasn't too big a deal.

  • @cerio3237
    @cerio3237 3 роки тому

    Nice job! :D

  • @BetterIntegra
    @BetterIntegra 3 роки тому

    Is there a line of code you could spot me that would prevent the balls from crossing over when this effect is mirrored. I'm guessing it would be along the likes of NUM_LEDS/2 to hard prevent them from going to the other 'side'.

    • @DavesGarage
      @DavesGarage  3 роки тому

      Hmmm... about the only think I can think of would be space them 2X as far apart, so make the strip 2X as long but keep the math otherwise the same, so you "displace" the second set of balls further down.

  • @ou81aswell
    @ou81aswell 3 роки тому

    Balls!

  • @theoldbigmoose
    @theoldbigmoose 2 роки тому

    As an ol guy (70) still trying to learn. Could someone help me with Dave's variable naming conventions? Like why _cLength ro _bMirrored or _fadeRate or g_LEDs... why the preceding underscore? why then the c before Length, b before Mirrored and g before LEDs?

    • @AvanaVana
      @AvanaVana Рік тому +1

      These prefixes often are meant to give an indication of the “type” of data that each variable should hold. A “c” prefix is a common prefix meaning “integer” or “long” type (“c” for count). A “b” prefix is used for Boolean (true/false) data types or sometimes byte data types. The “g” prefix could mean “global”, meaning it is accessible in the global scope of the code.

    • @theoldbigmoose
      @theoldbigmoose Рік тому

      @@AvanaVana Thank you Avana! I am self taught ( by failure and try again) programmer... so your insight is GREATLY appreciated by this ol guy! Do you know of a short article on naming conventions in C++ used by you professional programmers?

  • @Superdupershaun
    @Superdupershaun 3 роки тому

    Hey Dave. I really enjoy and appreciate all your videos. I wrote a code but need some help to make sure I did it right. Do you have a email or a way I can send it to you for inspection?

  • @miketony2069
    @miketony2069 3 роки тому

    I know this sounds strange but do you really type that fast? Jeez I'm jealous

  • @rickchowsr2532
    @rickchowsr2532 3 роки тому

    With all this work strictly with arduino Nano ?

  • @Tjup
    @Tjup 3 роки тому

    Hi again Dave, have u made a X-mas effect and a new year effect, it is soon New year etc, some years ago there was one on the net, but i cant find it anymore, and i cant program :/ so maybe u have some code laying around..

  • @burnermaster5375
    @burnermaster5375 3 роки тому

    Hi Dave. Love your channel brother. Got an idea for you. With the country finally on the re-open phase, this year we might actually be able to get out and do things that have been prohibited. Like parades. My American Legion runs the Memorial and 4th of July parades for my town. I want to build a magnetic array of strip ws2812b's for parade vehicle doors etc. The American Flag of course. I'm still a coding noob and could get them lit and flash etc, but I know with your key tickling ability you'd have 'ol Glory waving and sparkling! Consider this please? You rock.

  • @gonzo95682
    @gonzo95682 10 місяців тому

    Dave, How do I download the code?

  • @arindammajumder7781
    @arindammajumder7781 3 роки тому

    Is this platform io

  • @TheRealFrankWizza
    @TheRealFrankWizza 3 роки тому

    They amount of power you are displaying doesn't factor in the brightness.