Skip to content

LED patterns

Bendeguz edited this page May 29, 2026 · 2 revisions

Here are all the pattern functions for the LED ring with examples and images. To use the patterns, simply call the start functions once and the LEDs will keep updating until you call an other function or noPattern().

Note

Make sure you have first initialized the LED ring.

Patterns

positionDotPattern()

Parameters

  • byte red
  • byte green
  • byte blue

Usage

encoder.positionDotPattern(25, 25, 25); //start the dot pattern with a white, approx. 10% bright dot

Preview

coming soon

fillBarPattern()

Parameters

  • byte red
  • byte green
  • byte blue

Usage

encoder.fillBarPattern(25, 25, 25); //start the bar pattern which will be filled from the first pixel

Preview

coming soon

gradientBarPattern()

Description

This function is just like the bar pattern but with a gradient between the two colors with the start and end colors always being at full saturation at the end of the currently visible spectrum. With fixedGradientBarPattern() the full saturation is always at the first and last LED, even if that LED is off.

Parameters

  • byte startRed
  • byte startGreen
  • byte startBlue
  • byte endRed
  • byte endGreen
  • byte endBlue

Usage

//                     start colors | end colors
//                         r, g, b, |r, g, b
encoder.gradientBarPattern(0, 25, 0, 0, 0, 25); //start the bar pattern which will be filled from the first pixel with a green-blue gradient

Preview

coming soon

fixedGradientBarPattern()

Description

This function is like the default bar pattern but with a gradient with the start and end colors fixed to the first and last LEDs of the ring or bar instead of the first and last turned on LEDs. That behavior is available with the gradientBarPattern() function.

Parameters

  • byte startRed
  • byte startGreen
  • byte startBlue
  • byte endRed
  • byte endGreen
  • byte endBlue

Usage

//                     start colors | end colors
//                         r, g, b, |r, g, b
encoder.fixedGradientBarPattern(0, 25, 0, 0, 0, 25); //start the bar pattern which will be filled from the first pixel with a green-blue gradient

Preview

coming soon

Clone this wiki locally