コード例 #1
0
 /**
  * <summary>
  *   Changes the voltage source used to drive output bits.
  * <para>
  *   Remember to call the <c>saveToFlash()</c> method  to make sure the setting is kept after a reboot.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   a value among <c>YDigitalIO.OUTPUTVOLTAGE_USB_5V</c>, <c>YDigitalIO.OUTPUTVOLTAGE_USB_3V</c> and
  *   <c>YDigitalIO.OUTPUTVOLTAGE_EXT_V</c> corresponding to the voltage source used to drive output bits
  * </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_outputVoltage(int newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No DigitalIO connected");
     }
     if (newval == _OutputVoltage_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     // our enums start at 0 instead of the 'usual' -1 for invalid
     return(_func.set_outputVoltage(newval - 1));
 }