Пример #1
0
        static void Main(string[] args)
        {
            while (true)
            {
                for (int i = 0; i < LedCount; i++)
                {
                    // Set the i'th led to red
                    Leds[i] = new Spectrum.Color.HSV(_hue++, 1, 1).ToRGB();
                    //hue += increment;
                    // Show the leds

                    Show();
                    FadeAll(5);

                    // Wait a little bit before we loop around and do it again
                    Thread.Sleep(TimeSpan.FromMilliseconds(10));
                }

                for (int i = LedCount - 1; i >= 0; i--)
                {
                    // Set the i'th led to red
                    Leds[i] = new Spectrum.Color.HSV(_hue++, 1, 1).ToRGB();
                    // Show the leds
                    Show();
                    // now that we've shown the leds, reset the i'th led to black
                    // leds[i] = CRGB::Black;
                    FadeAll(5);
                    // Wait a little bit before we loop around and do it again
                    Thread.Sleep(TimeSpan.FromMilliseconds(10));
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            while (true)
            {
                _hue++;

                // random colored speckles that blink in and fade smoothly
                FadeAll(10);

                int pos = Random.Next(LedCount);
                Leds[pos] = new Spectrum.Color.HSV(_hue + Random.Next(16), 0.8, 1).ToRGB();

                Show();

                Thread.Sleep(TimeSpan.FromMilliseconds(10));
            }
        }