コード例 #1
0
 /**
  * <summary>
  *   Changes the PWM frequency used to control the motor.
  * <para>
  *   Low frequency is usually
  *   more efficient and may help the motor to start, but an audible noise might be
  *   generated. A higher frequency reduces the noise, but more energy is converted
  *   into heat. 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 PWM frequency used to control the motor
  * </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_frequency(double newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No Motor connected");
     }
     if (newval == _Frequency_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     return(_func.set_frequency(newval));
 }