Esempio n. 1
0
        public static void Main()
        {
            // create a new pwm controlled LED on pin 11
            var pwmLed = new LEDs.PwmLed(N.PWMChannels.PWM_PIN_D11, LEDs.TypicalForwardVoltage.Green);

            // turn the LED on at 50% power
            pwmLed.SetBrightness(0.5F);

            // keep the program alive.
            Thread.Sleep(Timeout.Infinite);
        }
Esempio n. 2
0
        /// <summary>
        /// Plug a green LED into pins 11 and GND, placing the longer lead (cathode) in pin 11.
        /// </summary>
        public static void Main()
        {
            // create a new pwm controlled LED on pin 11
            var pwmLed = new LEDs.PwmLed(N.PWMChannels.PWM_PIN_D11, LEDs.TypicalForwardVoltage.Green);

            // start a nice pulse animation
            pwmLed.StartPulse();

            // keep the app running
            Thread.Sleep(Timeout.Infinite);
        }
Esempio n. 3
0
        /// <summary>
        /// Plug a green LED into pins 11 and GND, placing the longer lead (cathode) in pin 11.
        /// </summary>
        public static void Main()
        {
            // create a new pwm controlled LED on pin 11
            var pwmLed = new LEDs.PwmLed(N.PWMChannels.PWM_PIN_D11, LEDs.TypicalForwardVoltage.Green);

            // alternate between blinking and pulsing the LED
            while (true)
            {
                pwmLed.StartBlink();
                Thread.Sleep(5000); // 5 seconds

                pwmLed.StartPulse(lowBrightness: 0.2F);
                Thread.Sleep(10000); // 10 seconds
            }
        }