Beispiel #1
0
        /// <summary>
        ///     Clear the display immediately, resetting all LEDs' values.
        /// </summary>
        /// <returns>An awaitable task</returns>
        public async Task Clear()
        {
            var oldAutoFlush = AutoFlush;

            AutoFlush = false;
            Leds.ForEach(led => led.SetRgb(0, 0, 0));
            await FlushAsync().ConfigureAwait(false);

            AutoFlush = oldAutoFlush;
        }
Beispiel #2
0
 /// <summary>
 /// Sets all colors of the image to a new color.
 /// </summary>
 /// <param name="r">The red part of the new color.</param>
 /// <param name="g">The green part of the new color.</param>
 /// <param name="b">The blue part of the new color.</param>
 public void SetAll(byte r, byte g, byte b)
 {
     Leds.ForEach(x => x.SetColor(r, g, b));
 }
Beispiel #3
0
 /// <summary>
 /// Sets all colors of the image to a new color.
 /// </summary>
 /// <param name="color">The new color.</param>
 public void SetAll(RgbColor color)
 {
     Leds.ForEach(x => x.SetColor(color));
 }