Btw, if you run (an older or not voltage regulated) projector, idle - no load - shows not what really what it will be... Another aspect: Powering on and off in 'rapid' succession such lamp is detrimental to its life span. I do not know the application / project, but you may consider a shutter rather than a short switch off, if this is what your project is about. A shutter you can build many ways... you can even take a relays/solenoid with something glued to the moving part for that, or a small stepper.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@user135957, I would not run a 12V Halogen on a 24V supply... the bulb may immediately go or the power supply may tank... because current doubles and heats up the filament to the melting point. Finding a 12V 2A power supply is easy... for example https://www.amazon.com/ZOSI-2000MA-Adapter-Security-Surveillance/dp/B0147V94OA/ref=asc_df_B0147V94OA --- just search the internet for 12V 2A power supply. You can get also power supply that is adjustable: https://www.amazon.com/woajepu-Universal-Switching-Selectable-Electronics/dp/B07WWBB9DY/ref=sr_1_3 --- I have a similar and it works just fine - just make sure nothing turns (accidentally) the knob... put a duct tape over it after you set it... ;_)
Btw, if you run (an older or not voltage regulated) projector, idle - no load - shows not what really what it will be... Another aspect: Powering on and off in 'rapid' succession such lamp is detrimental to its life span. I do not know the application / project, but you may consider a shutter rather than a short switch off, if this is what your project is about. A shutter you can build many ways... you can even take a relays/solenoid with something glued to the moving part for that, or a small stepper.