Okay, I got Danny Havenith’s water torture animation ported to FastLED.

Okay, I got Danny Havenith’s water torture animation ported to FastLED. Source code is on Gitub:

Nice job! I tip my hat to your code skills.

You are too kind – I am not a C++ programmer! I cribbed most of the basic skeleton from ?somewhere? when I did my blinky eyes project for Halloween 2015. Then I figured out how to do the Dependency Injection style of passing an external LED controller reference in by doing a lot of Googling.

I re-used that basic structure for this. I couldn’t figure out how to get a reference to the configured CFastLED object, so I settled for the CLEDController reference returned from addLeds(). And I was really rusty on pointers and references, but eventually hit the right combination of ‘*’, ‘&’, ‘.’, and ‘->’. :smiley:

I’m sure there’s stuff in my code that would make an experienced C++ coder say “WTF” more than a few times. Most of my work is in PHP and JavaScript, and the loose typing has made me a bit lazy!

One thing I do like about coding the animations as a separate class with an ‘animate()’ method called from ‘loop()’ is that it makes it possible to run multiple animations simultaneously, and layer effects on top (in many cases).

I’ve updated the code to allow each instance to have a custom color. You can also set the ‘gravity’ value individually now. I’ve update the demo .ino to demonstrate two droplets running at the same time, one blue, and the second one orange and with lower gravity.

Note, I also realized that the strip I’m testing with uses GRB color order, so the demo file reflects that, as well. So adjust accordingly for your own chipset.

I think my ws2812bs are GRB

@dougal Excellent updates.

Hi, great conversion. when trying it, it drips up the strip. which adjustment do i need to make to make it drip the other direction. thanks in advance.

Good observation. Following

@manny_miller With my WS2811 strip, the drip starts at the “data-in” side, and falls away from there. What kind of LEDs are you using?

But I was already thinking about how to add an option to reverse the direction. So watch this space. :wink:

im using ws281b. i do have a version using the neopixel library, but i doesnt have the realism. The nice bounce at the end :slight_smile:

Yeah that bounce is what makes it look like water. The strip ill be using is much shorter so fingers crossed it works as expected. Ill be posting it here when done :slight_smile:

@manny_miller Weird. So are you saying that you get drips starting at the far end of the strip, away from the data-in pixel where the controller connects? Or is your positioning just such that your controller is at the bottom, and your strip goes upwards from there?

@dougal I’m using the ws2812b strip. I have it on a stand with connections at the bottom and it drips up the strip. So yes it’s drips away from the connection end.

Odd behaviour

@manny_miller Ah, okay. I thought maybe it was pushing the pixels out weirdly. Anyhow, I started working on a method for animating in the other direction.

Okay, I finally got the reverse direction working, and the Github repo is updated. Sorry it took so long, but our household has been busy the past few days. I should probably make a new video…

Ok awesome. For some reason on my ws2812bs it shows mostly green. Is this normal?

@Cristian_Martinez Do you need to change the RGB color order in setup?

I probably do. Ima try that when i get home. Im just glad i was able to rig up and Arduino uno as an ISP programmer because none of my ISP programmers will read my attiny85s :’(