Skip to content

NeoPixelSegmentBus object API

Michael Miller edited this page Apr 6, 2023 · 2 revisions

NOTE: In most ways this will act like the NeoPixelBus object, except it will expose methods to draw strings. And key differences will be called out below but otherwise refer to the NeoPixelBus Api.

Construction and Template Arguments

The constructor will require the declaration of several template arguments that specialize the class to the sketch writer's needs. These class types are provided for the author and there is no need to implement them.

NeoPixelSegmentBus<T_COLOR_FEATURE, T_METHOD>(...)

T_COLOR_FEATURE - the specialization class for the color feature with SevenSegmentFeature as a good starting point.
T_METHOD - the specialization class for the method with NeoWs2811Method as a good starting point.

NeoPixelSegmentBus<,>(uint16_t countPixels ...)

The varied constructors will all take a countPixels. Consider this argument to be the count of 7-segment digits (modules) on the physical bus.

Here is an example.

NeoPixelSegmentBus<SevenSegmentFeature, NeoWs2811Method> strip(DigitCount, BusPin);

Methods

Please refer to the NeoPixelBus API Methods as they are compatible objects. Key uniqueness is listed below.

The ColorObject is a SevenSegDigit and not a normal color object like RgbColor.

void SetString(uint16_t indexDigit, const char* str, uint8_t brightness, uint8_t defaultBrightness = 0)

This will draw the provided string into the strip at the indexDigit using the provided brightness values.

  • indexDigit - The digit index in the strip to start drawing at.
  • str - a null terminated c++ string (char*) to draw. If you are using a String object, see the next method.
  • brightness - (0-255) The brightness value to use for the "on" parts of the chars of the string.
  • defaultBrightness - (0-255) The brightness value to use for the "off" parts of the chars of the string.

void SetString(uint16_t indexDigit, const String& str, uint8_t brightness, uint8_t defaultBrightness = 0)

  • indexDigit - The digit index in the strip to start drawing at.
  • str - a Arduino String object to draw.
  • brightness - (0-255) The brightness value to use for the "on" parts of the chars of the string.
  • defaultBrightness - (0-255) The brightness value to use for the "off" parts of the chars of the string.
Clone this wiki locally