Esempio n. 1
0
 /**
  * <summary>
  *   Changes the PWM frequency.
  * <para>
  *   The duty cycle is kept unchanged thanks to an
  *   automatic pulse width change, in other words, the change will not be applied
  *   before the end of the current period. This can significantly affect reaction
  *   time at low frequencies. If you call the matching module <c>saveToFlash()</c>
  *   method, the frequency will be kept after a device power cycle.
  *   To stop the PWM signal, do not set the frequency to zero, use the set_enabled()
  *   method instead.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   a floating point number corresponding to the PWM frequency
  * </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 PwmOutput connected");
     }
     if (newval == _Frequency_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     return(_func.set_frequency(newval));
 }