From 328aeb814d755a5bdbc32dc27959825ad3b9b064 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 5 Apr 2023 17:36:29 -0700 Subject: [PATCH] Created NeoPixelSegmentBus object API (markdown) --- NeoPixelSegmentBus-object-API.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 NeoPixelSegmentBus-object-API.md diff --git a/NeoPixelSegmentBus-object-API.md b/NeoPixelSegmentBus-object-API.md new file mode 100644 index 0000000..764ecb3 --- /dev/null +++ b/NeoPixelSegmentBus-object-API.md @@ -0,0 +1,35 @@ +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_](https://github.com/Makuna/NeoPixelBus/wiki/Neo-Features#neoabcdefgpssegmentfeature--sevensegmentfeature) - the specialization class for the color feature with SevenSegmentFeature as a good starting point. +[_T_METHOD_](https://github.com/Makuna/NeoPixelBus/wiki/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 strip(DigitCount, BusPin); + +``` + +# Methods +Please refer to the [NeoPixelBus API Methods](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object-API#methods) as they are compatible objects. Key uniqueness is listed below. + +The ColorObject is a [SevenSegDigit](https://github.com/Makuna/NeoPixelBus/wiki/SevenSegDigit-object-API) 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. \ No newline at end of file