Running Turn Signals on WS2812 and Arduino Tape

“Hop” said last year - it's time to jump
Rather, do the promised review of running turn signals.
I ordered 1 meter of black tape WS2812B (144 LEDs) in a silicone tube, I chose “Black 1m 144led IP67” when ordering (maybe someone will like the white color of the substrate, there is such a choice).
A little caution


Contact tapes were soldered to the tape on both sides.wires for connecting several pieces in series, as I did not need this, then on one side of the wire I soldered it off, sealed everything with a neutral sealant and wound some more black electrical tape.
A photo

Fastened to the glass using double-sided transparent adhesive tape, for example, such.
Installation Details

Now go to the electronic filling.
I used Arduino Nano 3but not so long ago discovered Wemos D1 mini on ESP8266
For about the same price, we get more buns

To implement the flashing mode during sharp braking was purchased such an acceleration sensor
The sketch tracks the level of deceleration whenpressing the brake pedal, if it exceeds 0.5G (sudden deceleration, but without a squeal of brakes), then to attract additional attention, the blinking mode is activated for a few seconds.
Control signals to the Arduino inputs with a "plus"stops, turn signals and reverse are fed through galvanic isolation - optocouplers with current-limiting resistors, which ultimately form the LOW level at the Arduino inputs (constantly attracted to the plus through 10kΩ resistors).
Power - 5 volts through a step-down DC-DC converter.
This whole thing is folded in a sandwich and packed in a suitable box on which the arrow marked the direction of installation for the correct orientation of the gravity sensor
Scheme and photo

Well, now the sketch itself (Arduino IDE)

I tried to comment as much as possible, butif there are questions, I will try to add comments (therefore, I place it in the review text, and not in the attached file). By the way, this also applies to other points of the review - I will also supplement it if there are significant questions in the comments.
And finally, a demonstration of the work (for the video I used a sketch with a demo mode).
Upd. He made a sketch with a demo mode specifically to contain everything in one short video.
The stop signal blinks only during sharp braking (described above), when smooth and standing in traffic jams, it just burns without irritating the drivers from behind.
The brightness in the dark is not excessive, because lights due to the tilt of the glass are directed more up than back.
Established lights work as usual, this strip duplicates them.