/** * <summary> * Changes the threshold voltage under which the controller automatically switches to error state * and prevents further current draw. * <para> * This setting prevent damage to a battery that can * occur when drawing current from an "empty" battery. * Note that whatever the cutoff threshold, the controller switches to undervoltage * error state if the power supply goes under 3V, even for a very brief time. * Remember to call the <c>saveToFlash()</c> * method of the module if the modification must be kept. * </para> * <para> * </para> * </summary> * <param name="newval"> * a floating point number corresponding to the threshold voltage under which the controller * automatically switches to error state * and prevents further current draw * </param> * <para> * </para> * <returns> * <c>0</c> if the call succeeds. * </returns> * <para> * On failure, throws an exception or returns a negative error code. * </para> */ public int set_cutOffVoltage(double newval) { if (_func == null) { throw new YoctoApiProxyException("No Motor connected"); } if (newval == _CutOffVoltage_INVALID) { return(YAPI.SUCCESS); } return(_func.set_cutOffVoltage(newval)); }