示例#1
0
        /// <summary>
        /// Sets the LED Output
        /// </summary>
        /// <param name="percentOutput">Output duty cycle expressed as percentage.</param>
        /// <param name="ledChannel">Channel to set.</param>
        public void SetLEDOutput(double percentOutput, LEDChannel ledChannel)
        {
            /* convert float to integral fixed pt */
            if (percentOutput > 1)
            {
                percentOutput = 1;
            }
            if (percentOutput < 0)
            {
                percentOutput = 0;
            }
            int dutyCycle = (int)(percentOutput * 1023); // [0,1023]

            CANifierNative.JNI_SetLEDOutput(m_handle, dutyCycle, (int)ledChannel);
        }
示例#2
0
        public int SetLEDOutput(float percentOutput, LEDChannel ledChannel)
        {
            /* convert float to integral fixed pt */
            if (percentOutput > 1)
            {
                percentOutput = 1;
            }
            if (percentOutput < 0)
            {
                percentOutput = 0;
            }
            int dutyCycle = (int)(percentOutput * 1023); // [0,1023]

            return(_ll.SetLEDOutput(dutyCycle, (uint)ledChannel));
        }