When LEDs turn on, they reach their full brightness more quickly than incandescent lights do, and when they turn off, they reach full darkness more quickly than incandescent lights. The effect is particularly noticeable when comparing flashing LEDs with flashing incandescent lights, such as the red lights on railroad crossing signals. The difference is slight, but it’s perceptible enough that they don’t look quite right on layouts depicting a time before LEDs were used in crossing signals. To look right, there should be a barely perceptible moment in time when you can see some amount of light in both lights at the same time. I’ve wanted to find a way to simulate that effect by making the LEDs in my signals fade on and off at a similar speed, instead of having them just alternate between on and off. Having recently discovered Arduinos, I’m excited that I can achieve this look on my future crossing signals (and other types of lights) by using an Arduino to control them.
I wrote code that creates a timer for alternating between two phases, and initiates fade-on and fade-off functions for both lights each time the phase changes, at a suitable rate for …