switch to ground, hit play and switch to on
it will convert 24v to 5v 0mA to ~50mA with only 50mV ripple
can go up to 100mA if 100-150mv ripple is ok
not perfect but good to learn switched mode power supply
principle :
mesure input currant Iin
mesure output currant Iout
mesure voltage Vout
mesure setpoint Vin
output = Gain * (Vgain * (Vin - Vout) - Igain * (Iin - Iout))
out is compared to 0.1V-23.9V triangle wave to produce variable duty cycle to activate gate of MOSFET