示例#1
0
        public void EnablePWM(bcm2835PWMClockDivider Clock = bcm2835PWMClockDivider.BCM2835_PWM_CLOCK_DIVIDER_2048,
                              uint Range = 65535, uint Data = 32767, bool MarkSpace = false, bool Enabled = false)
        {
            if (pwm != null)
            {
                pwm.Dispose();
            }

            pwm = new RaspPWM(Clock, Range, Data, MarkSpace, Enabled);
        }
示例#2
0
        public void EnablePWM(bcm2835PWMClockDivider Clock = bcm2835PWMClockDivider.BCM2835_PWM_CLOCK_DIVIDER_16384,
                              uint Range = 65535, uint Data = 32767, bool MarkSpace = false, bool Enabled = false)
        {
            if (pwm != null)
            {
                pwm.Dispose();
            }

            var pin = gpio[RPiGPIOPin.RPI_GPIO_P1_12];

            if (pwm != null)
            {
                prevFunction = pin.Function;
            }

            pin.Function = GPIOFunctionSelect.Function_ALT5;

            pwm = new RaspPWM(Clock, Range, Data, MarkSpace, Enabled);
        }