Diode laser control circuits and code