My problem is finding the module which controls the dome light in my Forester in order to replace the control transistor after I blew it by shorting out the lamp whilst fitting a LED substitute module.
Since manufacturers are particularly careful not to supply service information
What has this to do with the OP question? Well, a microcontroller such as Arduino uses is exactly what is used in cars to provide this function, but requires a (reasonably sturdy) control transistor or FET to actually switch the lamp and control the dimming using PWM. you can often discern the "steps" in the dimming algorithm.