Controlling DC voltage with Arduino
I'll try concluding on the comments a bit, and add personal commentary.

The standard way is really PWM'ing LEDs. When using a high PWM frequency, humans can't detect that it's PWM. There's relatively solid statistics and theory behind that's the case.
If you don't want PWM, the appropriate way to dim an LED is to vary the current (illumination strength is pretty much proportional to current, which itself is pretty much exponential with voltage).
You can build a controlled current source using your MCU, and MOSFETs

Personal notes:

if your child can't sleep with a given light, but with another:

account for external control factors (sound emissions, light position, time of day, the fact that an incandescent bulb makes more infrared heat radiation than visible light and your child might just like the warming effect)
it's well-known that &quot;bluer&quot; lights tend to keep people awake more than warmish white tints. (and the latter is exactly what the incandescent light provides) You can buy &quot;warm&quot; white LEDs. What you're looking for is &quot;color temperature&quot;, and that should be relatively low (2700 K - 2900 K).


You could use a step-down converter LED driver IC. That has the advantage of not being a linear solution and hence not getting as hot.

Many come with a current limit pin, which needs to be connected to a low-side shunt resistor. When the current is high, the voltage over that resistor is high. You can use an opamp voltage adder to add a voltage to that voltage so that you can adjust the current externally.
You could use the PWM followed by a simple RC low-pass filter to generate a voltage to add to that, giving you software. That's a voltage DAC!


Of course, you could also build a linear regulator:

PWM -&gt; low pass for a voltage DAC
12V -&gt;  high-side MOSFET configuration (that's nontrivial) driven by opamp -&gt; LEDs -&gt; Ground as the power chain
low side of MOSFET -&gt; Voltage divider to a voltage range your DAC could also produce (e.g. 12 V maps to 3V)
connect divided voltage to non-inverting input of opamp from above. The opamp is now in a negative-feedback configuration, which means it will try to output exactly as much as necessary to make the voltage at its two inputs equal.
connect DAC to non-inverting input. This now allows your MCU to control the voltage at the voltage divider's output, and hence the voltage that the LEDs see.
pull down non-inverting input via 1 MΩ to ground. That way, when your MCU is off/malfunctions, the lights turn off.