示例#1
0
            public RemotePinImpl(Cpu.Pin pin, AnalogChannel analogChannel, PWMChannel pwmChannel)
            {
                _pin           = pin;
                _analogChannel = analogChannel;
                _pwmChannel    = pwmChannel;

                PreviousValue = -1;
            }
示例#2
0
        public int SetPWMOutput(PWMChannel pwmChannel, float dutyCycle)
        {
            if (dutyCycle < 0)
            {
                dutyCycle = 0;
            }
            else if (dutyCycle > 1)
            {
                dutyCycle = 1;
            }

            int dutyCyc10bit = (int)(1023 * dutyCycle);

            return(_ll.SetPWMOutput((uint)pwmChannel, dutyCyc10bit));
        }
示例#3
0
 /// <summary>
 /// Gets the PWM Input.
 /// </summary>
 /// <param name="pwmChannel">PWM channel to get.</param>
 /// <param name="dutyCycleAndPeriod">Double array to hold Duty Cycle [0] and Period [1].</param>
 public void GetPWMInput(PWMChannel pwmChannel, double[] dutyCycleAndPeriod)
 {
     CANifierNative.JNI_GetPWMInput(m_handle, (int)pwmChannel, dutyCycleAndPeriod);
 }
示例#4
0
 public int GetPwmInput(PWMChannel pwmChannel, float[] dutyCycleAndPeriod)
 {
     return(_ll.GetPwmInput((uint)pwmChannel, dutyCycleAndPeriod));
 }
示例#5
0
 public int EnablePWMOutput(PWMChannel pwmChannel, bool bEnable)
 {
     return(_ll.EnablePWMOutput((uint)pwmChannel, bEnable));
 }
示例#6
0
 public ErrorCode GetPwmInput(PWMChannel pwmChannel, float[] dutyCycleAndPeriod)
 {
     return((ErrorCode)_ll.GetPwmInput((uint)pwmChannel, dutyCycleAndPeriod));
 }
示例#7
0
 /**
  * Gets the PWM Input
  * @param pwmChannel  PWM channel to get.
  * @param pulseWidthAndPeriod	Double array to hold Pulse Width (microseconds) [0] and Period (microseconds) [1].
  * @return Error Code generated by function. 0 indicates no error.
  */
 public ErrorCode GetPWMInput(PWMChannel pwmChannel, float[] pulseWidthAndPeriod)
 {
     return((ErrorCode)_ll.GetPWMInput((uint)pwmChannel, pulseWidthAndPeriod));
 }
示例#8
0
 public ErrorCode GetPwmInput(PWMChannel pwmChannel, float[] pulseWidthAndPeriod)
 {
     return(GetPWMInput(pwmChannel, pulseWidthAndPeriod));
 }