Dark IV Diode Fitting in C