MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
Loading...
Searching...
No Matches
max_matrix::MatrixOf< NumberOfModules > Class Template Reference

A Matrix with the buffer for a chain of NumberOfModules modules. More...

#include <MaxMatrix.h>

Inheritance diagram for max_matrix::MatrixOf< NumberOfModules >:
max_matrix::internal::Buffer< NumberOfModules > max_matrix::Matrix

Public Member Functions

 MatrixOf (uint8_t data_in_pin, uint8_t chip_select_pin, uint8_t clock_pin)
 Makes the matrix on the chain at these pins.
MAXMATRIX_NODISCARD uint8_t GetNumberOfModules () const
 Returns the modules of the chain.
MAXMATRIX_NODISCARD uint8_t GetNumberOfColumns () const
 Returns the columns of the matrix, eight per module.
MAXMATRIX_NODISCARD State GetState () const
 Returns what the matrix is doing; State::kReady once a shifted text is complete.
MAXMATRIX_NODISCARD bool GetAutoUpdate () const
 Returns whether every function that draws sends its result at once; see SetAutoUpdate().
MAXMATRIX_NODISCARD uint16_t GetShiftInterval () const
 Returns the milliseconds per column of a shifting text; see SetShiftInterval().
MAXMATRIX_NODISCARD uint8_t GetDataInPin () const
 Returns the pin DIN of the chain is connected to.
MAXMATRIX_NODISCARD uint8_t GetChipSelectPin () const
 Returns the pin CS of the chain is connected to.
MAXMATRIX_NODISCARD uint8_t GetClockPin () const
 Returns the pin CLK of the chain is connected to.
MAXMATRIX_NODISCARD ModuleType GetModuleType () const
 Returns how the LEDs of every module are wired; see SetModuleType().
MAXMATRIX_NODISCARD MatrixOrientation GetMatrixOrientation () const
 Returns how the whole matrix is turned; see SetMatrixOrientation().
MAXMATRIX_NODISCARD uint8_t GetSpaceBetweenChars () const
 Returns the empty columns between two chars of a text.
MAXMATRIX_NODISCARD Result< Byte > GetColumn (int16_t column)
 Returns a column of the matrix.
MAXMATRIX_NODISCARD Result< Byte > GetColumn (uint8_t module, uint8_t column)
 Returns a column of a module.
MAXMATRIX_NODISCARD Status GetRow (int16_t row, span< Byte > values)
 Gives a row of the matrix, one byte per module.
MAXMATRIX_NODISCARD Result< Byte > GetRow (uint8_t module, uint8_t row)
 Returns a row of a module.
MAXMATRIX_NODISCARD Result< bool > GetDot (int16_t column, int16_t row)
 Returns whether a dot is lit.
MAXMATRIX_NODISCARD span< uint8_t const > GetFont () const
 Returns the font every char is drawn in.
void SetDataInPin (uint8_t data_in_pin)
 Sets the pin DIN of the chain is connected to.
void SetChipSelectPin (uint8_t chip_select_pin)
 Sets the pin CS of the chain is connected to.
void SetClockPin (uint8_t clock_pin)
 Sets the pin CLK of the chain is connected to.
void SetAutoUpdate (bool auto_update)
 Sets whether what is drawn is sent at once.
void SetShiftInterval (uint16_t shift_interval)
 Sets the milliseconds per column of a shifting text.
Status SetIntensity (uint8_t intensity)
 Sets how bright every LED is lit.
void SetShutdown (bool shutdown)
 Turns the LEDs of every MAX7219 off, or on again.
void SetDisplayTest (bool display_test)
 Lights every LED at full brightness, or shows the picture again.
void SetColumn (int16_t column, Byte value)
 Sets a column of the matrix.
void SetColumn (uint8_t module, uint8_t column, Byte value)
 Sets a column of a module.
void SetRow (int16_t row, span< Byte const > values)
 Sets a row of the matrix, one byte per module.
void SetRow (uint8_t module, uint8_t row, Byte value)
 Sets a row of a module.
void SetDot (int16_t column, int16_t row, bool value)
 Lights a dot or turns it off.
void DrawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, bool value)
 Draws a straight line from one dot to another, both ends included.
void DrawRect (int16_t x, int16_t y, int16_t width, int16_t height, bool value)
 Draws the outline of a rectangle.
void FillRect (int16_t x, int16_t y, int16_t width, int16_t height, bool value)
 Draws a rectangle with its inside.
void DrawCircle (int16_t x, int16_t y, int16_t radius, bool value)
 Draws the outline of a circle.
void DrawBitmap (int16_t x, int16_t y, span< uint8_t const > bitmap)
 Draws a picture from flash, 8 rows high, with its top left corner at x, y.
void DrawBitmap (int16_t x, int16_t y, uint8_t height, span< uint8_t const > bitmap)
 Draws a picture from flash with its top left corner at x, y.
Status SetChar (int16_t x, int16_t y, char c)
 Draws a char with its top left corner at x, y.
Status SetCharWithShift (char c)
 Starts shifting a char in from the right, until it stands at the right edge.
Status SetText (span< char const > text)
 Draws a text from the left edge, as far as it fits.
Status SetTextWithShift (span< char const > text, bool repeat=false)
 Starts shifting a text in from the right, until its last char stands at the right edge, or over and over.
void StopShift ()
 Stops a shifting text or char where it is.
void SetSpaceBetweenChars (uint8_t space_between_chars)
 Sets the empty columns between two chars of a text.
Status SetFont (span< uint8_t const > font)
 Sets the font every char is drawn in from now on.
void SetSprite (int16_t x, int16_t y, Sprite const &sprite)
 Draws a sprite with its top left corner at x, y.
void SetModuleType (ModuleType module_type)
 Sets how the LEDs of every module are wired.
void SetMatrixOrientation (MatrixOrientation matrix_orientation)
 Sets how the whole matrix is turned.
void Init ()
 Sets the chain up: the pins, every register of every MAX7219, and every LED off.
void ShiftTask ()
 Shifts a text or a char one column further, if the shift interval has passed.
void Update ()
 Sends what was drawn since the last update.
void Clear ()
 Turns every LED off.
void RegisterWrite (uint8_t register_address, uint8_t register_value)
 Writes one register of every MAX7219 in the chain, at once.
void ShiftLeft (ShiftFill fill=ShiftFill::kZero)
 Shifts the whole picture one column to the left.
Byte ShiftLeft (Byte shifted_in)
 Shifts the whole picture one column to the left, with a column of the sketch coming in at the right.
void ShiftRight (ShiftFill fill=ShiftFill::kZero)
 Shifts the whole picture one column to the right.
Byte ShiftRight (Byte shifted_in)
 Shifts the whole picture one column to the right, with a column of the sketch coming in at the left.
void ShiftUp (ShiftFill fill=ShiftFill::kZero)
 Shifts the whole picture one row up.
void ShiftDown (ShiftFill fill=ShiftFill::kZero)
 Shifts the whole picture one row down.

Detailed Description

template<uint8_t NumberOfModules>
class max_matrix::MatrixOf< NumberOfModules >

A Matrix with the buffer for a chain of NumberOfModules modules.

What a sketch makes: the length of the chain is part of the type, the buffer takes eight bytes per module, and a length the library cannot drive does not compile.

max_matrix::MatrixOf<4> matrix(kDataInPin, kChipSelectPin, kClockPin);
A Matrix with the buffer for a chain of NumberOfModules modules.
Definition MaxMatrix.h:734
Template Parameters
NumberOfModulesThe modules of the chain, 1 to kMaxNumberOfModules.

Constructor & Destructor Documentation

◆ MatrixOf()

template<uint8_t NumberOfModules>
max_matrix::MatrixOf< NumberOfModules >::MatrixOf ( uint8_t data_in_pin,
uint8_t chip_select_pin,
uint8_t clock_pin )
inline

Makes the matrix on the chain at these pins.

Nothing is sent until Init().

Parameters
[in]data_in_pinThe pin DIN of the chain is connected to.
[in]chip_select_pinThe pin CS of the chain is connected to.
[in]clock_pinThe pin CLK of the chain is connected to.

Member Function Documentation

◆ DrawBitmap() [1/2]

void max_matrix::Matrix::DrawBitmap ( int16_t x,
int16_t y,
span< uint8_t const > bitmap )
inlineinherited

Draws a picture from flash, 8 rows high, with its top left corner at x, y.

The picture is a column per byte, bit 0 the top row, as a glyph of a font: a 0 bit turns its dot off. What lies off the matrix is left out.

constexpr auto kHeart PROGMEM{
max_matrix::make_array<uint8_t>(0x0C, 0x1E, 0x3C, 0x1E, 0x0C)};
matrix.DrawBitmap(3, 0, kHeart);
constexpr array< T, sizeof...(Values)> make_array(Values... values)
Returns an array of T of its values, with the size taken from them.
Definition array.h:185
Parameters
[in]xThe column of the left edge; it may lie off the matrix.
[in]yThe row of the top edge; it may lie off the matrix.
[in]bitmapThe columns, in PROGMEM; as many as it holds.

◆ DrawBitmap() [2/2]

void max_matrix::Matrix::DrawBitmap ( int16_t x,
int16_t y,
uint8_t height,
span< uint8_t const > bitmap )
inlineinherited

Draws a picture from flash with its top left corner at x, y.

The picture is a column per byte, bit 0 the top row, as a glyph of a font: a 0 bit turns its dot off. Rows below height are left as they are, and what lies off the panel is left out.

The height goes before the bitmap, so that a width after it, as the columns were once given, does not compile: the bitmap brings its width.

Parameters
[in]xThe column of the left edge; it may lie off the panel.
[in]yThe row of the top edge; it may lie off the panel.
[in]heightThe rows of the picture, 1 to 8.
[in]bitmapThe columns, in PROGMEM; as many as it holds.

◆ DrawCircle()

void max_matrix::Matrix::DrawCircle ( int16_t x,
int16_t y,
int16_t radius,
bool value )
inlineinherited

Draws the outline of a circle.

What lies off the panel is left out, as for SetDot(). A radius of 0 draws the centre only, a negative one nothing.

Parameters
[in]xThe column of the centre.
[in]yThe row of the centre.
[in]radiusThe dots from the centre to the outline; 3 fills the height of the panel.
[in]valueTrue to light the outline, false to turn it off.

◆ DrawLine()

void max_matrix::Matrix::DrawLine ( int16_t x0,
int16_t y0,
int16_t x1,
int16_t y1,
bool value )
inlineinherited

Draws a straight line from one dot to another, both ends included.

What lies off the panel is left out, as for SetDot(); the ends may lie off it.

Parameters
[in]x0The column of the first end.
[in]y0The row of the first end.
[in]x1The column of the second end.
[in]y1The row of the second end.
[in]valueTrue to light the line, false to turn it off.

◆ DrawRect()

void max_matrix::Matrix::DrawRect ( int16_t x,
int16_t y,
int16_t width,
int16_t height,
bool value )
inlineinherited

Draws the outline of a rectangle.

What lies off the panel is left out, as for SetDot(). A width or height of 0 or less draws nothing.

Parameters
[in]xThe column of the left edge.
[in]yThe row of the top edge.
[in]widthThe columns it spans.
[in]heightThe rows it spans.
[in]valueTrue to light the outline, false to turn it off.

◆ FillRect()

void max_matrix::Matrix::FillRect ( int16_t x,
int16_t y,
int16_t width,
int16_t height,
bool value )
inlineinherited

Draws a rectangle with its inside.

What lies off the panel is left out, as for SetDot(). A width or height of 0 or less draws nothing.

Parameters
[in]xThe column of the left edge.
[in]yThe row of the top edge.
[in]widthThe columns it spans.
[in]heightThe rows it spans.
[in]valueTrue to light it, false to turn it off.

◆ GetColumn() [1/2]

MAXMATRIX_NODISCARD Result< Byte > max_matrix::Matrix::GetColumn ( int16_t column)
inlineinherited

Returns a column of the matrix.

Parameters
[in]columnThe column, from 0 at the left to eight times the modules.
Returns
The column, bit 0 the top row, or Error::kOutOfRange if it lies off the panel.

◆ GetColumn() [2/2]

MAXMATRIX_NODISCARD Result< Byte > max_matrix::Matrix::GetColumn ( uint8_t module,
uint8_t column )
inlineinherited

Returns a column of a module.

Parameters
[in]moduleThe module, from 0 at the left.
[in]columnThe column within the module, 0 to 7.
Returns
The column, bit 0 the top row, or Error::kOutOfRange if the module or the column does not exist.

◆ GetDot()

MAXMATRIX_NODISCARD Result< bool > max_matrix::Matrix::GetDot ( int16_t column,
int16_t row )
inlineinherited

Returns whether a dot is lit.

Parameters
[in]columnThe column, negative to the left of the panel.
[in]rowThe row, negative above the panel.
Returns
Whether the dot is lit, or Error::kOutOfRange if it lies off the panel.

◆ GetFont()

MAXMATRIX_NODISCARD span< uint8_t const > max_matrix::Matrix::GetFont ( ) const
inlineinherited

Returns the font every char is drawn in.

◆ GetRow() [1/2]

MAXMATRIX_NODISCARD Status max_matrix::Matrix::GetRow ( int16_t row,
span< Byte > values )
inlineinherited

Gives a row of the matrix, one byte per module.

matrix.GetRow(0, row);
A C array of N elements that knows its size.
Definition array.h:42
Parameters
[in]rowThe row, from 0 at the top.
[out]valuesThe row, bit 7 of each byte the leftmost column of its module; left as it was on an error.
Returns
Error::kOk, or Error::kOutOfRange if the row lies off the panel or values has fewer bytes than there are modules.

◆ GetRow() [2/2]

MAXMATRIX_NODISCARD Result< Byte > max_matrix::Matrix::GetRow ( uint8_t module,
uint8_t row )
inlineinherited

Returns a row of a module.

The leftmost column is in bit 7, so that a row written as a binary literal looks like the dots it stands for.

Parameters
[in]moduleThe module, from 0 at the left.
[in]rowThe row within the module, 0 to 7.
Returns
The row, bit 7 the leftmost column, or Error::kOutOfRange if the module or the row does not exist.

◆ Init()

void max_matrix::Matrix::Init ( )
inherited

Sets the chain up: the pins, every register of every MAX7219, and every LED off.

The intensity is set to its start value. The cleared matrix is sent even with auto update off, as after power-up the LEDs show anything.

◆ RegisterWrite()

void max_matrix::Matrix::RegisterWrite ( uint8_t register_address,
uint8_t register_value )
inlineinherited

Writes one register of every MAX7219 in the chain, at once.

Parameters
[in]register_addressThe address of the register, one of the MAX7219_REG_..._ADDRESS.
[in]register_valueThe value for every module.

◆ SetAutoUpdate()

void max_matrix::Matrix::SetAutoUpdate ( bool auto_update)
inherited

Sets whether what is drawn is sent at once.

On, the default, every function that draws sends its result before it returns. Off, only Update() sends. Turning it on sends what was drawn while it was off. A Batch turns it off for a block and back on at its end.

Parameters
[in]auto_updateTrue to send after every function that draws.

◆ SetChar()

Status max_matrix::Matrix::SetChar ( int16_t x,
int16_t y,
char c )
inlineinherited

Draws a char with its top left corner at x, y.

What lies off the matrix is left out.

Parameters
[in]xThe column of the left edge; it may lie off the matrix.
[in]yThe row of the top edge; it may lie off the matrix.
[in]cThe char, latin-1.
Returns
Error::kOk, or Error::kUnknownChar if the font has no sprite for the char; nothing is drawn then.

◆ SetCharWithShift()

Status max_matrix::Matrix::SetCharWithShift ( char c)
inherited

Starts shifting a char in from the right, until it stands at the right edge.

ShiftTask() takes the steps; GetState() is State::kCharShift until the char stands.

Parameters
[in]cThe char, latin-1.
Returns
Error::kOk, or Error::kUnknownChar if the font has no sprite for the char; nothing starts then.

◆ SetChipSelectPin()

void max_matrix::Matrix::SetChipSelectPin ( uint8_t chip_select_pin)
inlineinherited

Sets the pin CS of the chain is connected to.

Parameters
[in]chip_select_pinThe pin; Init() makes it an output.

◆ SetClockPin()

void max_matrix::Matrix::SetClockPin ( uint8_t clock_pin)
inlineinherited

Sets the pin CLK of the chain is connected to.

Parameters
[in]clock_pinThe pin; Init() makes it an output.

◆ SetColumn() [1/2]

void max_matrix::Matrix::SetColumn ( int16_t column,
Byte value )
inlineinherited

Sets a column of the matrix.

A column off the panel is left out, as for SetDot().

Parameters
[in]columnThe column, from 0 at the left to eight times the modules.
[in]valueThe column, bit 0 the top row.

◆ SetColumn() [2/2]

void max_matrix::Matrix::SetColumn ( uint8_t module,
uint8_t column,
Byte value )
inlineinherited

Sets a column of a module.

A module or a column that does not exist is left out.

Parameters
[in]moduleThe module, from 0 at the left.
[in]columnThe column within the module, 0 to 7.
[in]valueThe column, bit 0 the top row.

◆ SetDataInPin()

void max_matrix::Matrix::SetDataInPin ( uint8_t data_in_pin)
inlineinherited

Sets the pin DIN of the chain is connected to.

Parameters
[in]data_in_pinThe pin; Init() makes it an output.

◆ SetDisplayTest()

void max_matrix::Matrix::SetDisplayTest ( bool display_test)
inherited

Lights every LED at full brightness, or shows the picture again.

The display test of the MAX7219 overrides the picture and the intensity without changing either, and also lights a module in shutdown: a check that every LED and every module of the chain works. Sent at once, whatever auto update is.

Parameters
[in]display_testTrue to light every LED, false to show the picture again.
Precondition
Init().

◆ SetDot()

void max_matrix::Matrix::SetDot ( int16_t column,
int16_t row,
bool value )
inlineinherited

Lights a dot or turns it off.

A dot off the panel is left out rather than reported: a sprite, a line or a text that lies partly off the panel is drawn all the time while something moves in or out, and a sketch would only have to clip it itself. Adafruit GFX's drawPixel() and Rust's embedded-graphics do the same.

Parameters
[in]columnThe column, negative to the left of the panel.
[in]rowThe row, negative above the panel.
[in]valueTrue to light it.

◆ SetFont()

Status max_matrix::Matrix::SetFont ( span< uint8_t const > font)
inlineinherited

Sets the font every char is drawn in from now on.

A font of MD_MAX72XX serves with its bytes as they are, in make_array() rather than its C array; Font describes the format. Chars drawn already stay as they are, and a char that shifts in goes on in the font it started in. kDefaultFont is the font MaxMatrix starts with.

constexpr auto kBigFont PROGMEM{
matrix.SetFont(kBigFont);

The length of the font is that of its array, which the span takes from it, so that the whole font is checked once, here, and no char can be read past its end. A font known only by its address, as one of a table of fonts, is passed with its length, {font, size}. A font in RAM, without PROGMEM, fails as well, almost always, as the Uno reads it from flash.

Parameters
[in]fontThe font, in flash; it has to live as long as it is set, as a PROGMEM array does.
Returns
Error::kOk, or Error::kNotAFont if Font::CheckFont() does not take it; the font then stays as it was.

◆ SetIntensity()

Status max_matrix::Matrix::SetIntensity ( uint8_t intensity)
inherited

Sets how bright every LED is lit.

Sent at once, whatever auto update is.

Parameters
[in]intensityThe intensity, 0 to 15.
Returns
Error::kOk, or Error::kOutOfRange above 15; the intensity then stays as it was.

◆ SetMatrixOrientation()

void max_matrix::Matrix::SetMatrixOrientation ( MatrixOrientation matrix_orientation)
inlineinherited

Sets how the whole matrix is turned.

By 180 degrees for a board mounted upside down, with the module at the input then on the left; in addition to the module type. The picture stays as the viewer sees it; the buffer is turned along.

Parameters
[in]matrix_orientation0 or 180 degrees.

◆ SetModuleType()

void max_matrix::Matrix::SetModuleType ( ModuleType module_type)
inlineinherited

Sets how the LEDs of every module are wired.

The picture stays as the viewer sees it; the buffer is rewritten along.

Parameters
[in]module_typeThe type of the modules, as MD_MAX72XX names it.

◆ SetRow() [1/2]

void max_matrix::Matrix::SetRow ( int16_t row,
span< Byte const > values )
inlineinherited

Sets a row of the matrix, one byte per module.

A row off the panel is left out, as for SetDot(), and so are the modules beyond the bytes given, or the bytes beyond the modules.

Parameters
[in]rowThe row, from 0 at the top.
[in]valuesThe row, bit 7 of each byte the leftmost column of its module.

◆ SetRow() [2/2]

void max_matrix::Matrix::SetRow ( uint8_t module,
uint8_t row,
Byte value )
inlineinherited

Sets a row of a module.

A module or a row that does not exist is left out.

Parameters
[in]moduleThe module, from 0 at the left.
[in]rowThe row within the module, 0 to 7.
[in]valueThe row, bit 7 the leftmost column.

◆ SetShiftInterval()

void max_matrix::Matrix::SetShiftInterval ( uint16_t shift_interval)
inlineinherited

Sets the milliseconds per column of a shifting text.

Parameters
[in]shift_intervalThe milliseconds; 0 makes every ShiftTask() a step.

◆ SetShutdown()

void max_matrix::Matrix::SetShutdown ( bool shutdown)
inherited

Turns the LEDs of every MAX7219 off, or on again.

In shutdown the MAX7219s draw next to no current, keep their registers and still take what is drawn: the LEDs show the picture as it is then once the shutdown ends, at the intensity they had. Sent at once, whatever auto update is.

Parameters
[in]shutdownTrue to turn the LEDs off, false to turn them on again.
Precondition
Init().

◆ SetSpaceBetweenChars()

void max_matrix::Matrix::SetSpaceBetweenChars ( uint8_t space_between_chars)
inlineinherited

Sets the empty columns between two chars of a text.

Parameters
[in]space_between_charsThe number of empty columns.

◆ SetSprite()

void max_matrix::Matrix::SetSprite ( int16_t x,
int16_t y,
Sprite const & sprite )
inlineinherited

Draws a sprite with its top left corner at x, y.

What lies off the matrix is left out.

Parameters
[in]xThe column of the left edge; it may lie off the matrix.
[in]yThe row of the top edge; it may lie off the matrix.
[in]spriteThe sprite.

◆ SetText()

Status max_matrix::Matrix::SetText ( span< char const > text)
inlineinherited

Draws a text from the left edge, as far as it fits.

A text in quotes or a char array passes as it is; a text known only by a pointer is passed with its length, {text, strlen(text)}.

Parameters
[in]textThe text, UTF-8 or latin-1, up to its terminating null character or the end of the span, whichever comes first.
Returns
Error::kOk; Error::kNoText if text is an empty span; or Error::kUnknownChar if a char of the text is not in the font, with the chars before it drawn.

◆ SetTextWithShift()

Status max_matrix::Matrix::SetTextWithShift ( span< char const > text,
bool repeat = false )
inherited

Starts shifting a text in from the right, until its last char stands at the right edge, or over and over.

ShiftTask() takes the steps; GetState() is State::kStringShift until the text stands. A text that repeats goes on with its first char right after its last, so a few spaces at its end keep the two apart; it shifts until StopShift() or the next shift starts.

Parameters
[in]textThe text, UTF-8 or latin-1, up to its terminating null character or the end of the span, as for SetText(). It has to live until the text stands, or as long as it repeats.
[in]repeatTrue to start over after the last char, without end.
Returns
Error::kOk, or Error::kNoText if text is an empty span; nothing starts then.

◆ ShiftDown()

void max_matrix::Matrix::ShiftDown ( ShiftFill fill = ShiftFill::kZero)
inlineinherited

Shifts the whole picture one row down.

Parameters
[in]fillWhat comes in at the top: an empty row, the bottom one, or the top one as it was.

◆ ShiftLeft() [1/2]

Byte max_matrix::Matrix::ShiftLeft ( Byte shifted_in)
inlineinherited

Shifts the whole picture one column to the left, with a column of the sketch coming in at the right.

A sketch that feeds a column on every step gets a band of any length, from flash, a sensor or a calculation, and what falls out at the left, to keep or pass on.

Parameters
[in]shifted_inThe column that comes in, bit 0 the top row.
Returns
The column that fell out at the left, bit 0 the top row.

◆ ShiftLeft() [2/2]

void max_matrix::Matrix::ShiftLeft ( ShiftFill fill = ShiftFill::kZero)
inlineinherited

Shifts the whole picture one column to the left.

Parameters
[in]fillWhat comes in at the right: an empty column, the leftmost one, or the rightmost one as it was.

◆ ShiftRight() [1/2]

Byte max_matrix::Matrix::ShiftRight ( Byte shifted_in)
inlineinherited

Shifts the whole picture one column to the right, with a column of the sketch coming in at the left.

Parameters
[in]shifted_inThe column that comes in, bit 0 the top row.
Returns
The column that fell out at the right, bit 0 the top row.

◆ ShiftRight() [2/2]

void max_matrix::Matrix::ShiftRight ( ShiftFill fill = ShiftFill::kZero)
inlineinherited

Shifts the whole picture one column to the right.

Parameters
[in]fillWhat comes in at the left: an empty column, the rightmost one, or the leftmost one as it was.

◆ ShiftTask()

void max_matrix::Matrix::ShiftTask ( )
inherited

Shifts a text or a char one column further, if the shift interval has passed.

Call it on every loop() until GetState() is State::kReady again. It takes a step only when the shift interval has passed since the last one, and with an interval of 0 on every call. A call that comes late takes one step, not the ones it missed: catching up would make the text jump after loop() was held up.

Precondition
SetCharWithShift() or SetTextWithShift() started a shift.

◆ ShiftUp()

void max_matrix::Matrix::ShiftUp ( ShiftFill fill = ShiftFill::kZero)
inlineinherited

Shifts the whole picture one row up.

Parameters
[in]fillWhat comes in at the bottom: an empty row, the top one, or the bottom one as it was.

◆ StopShift()

void max_matrix::Matrix::StopShift ( )
inherited

Stops a shifting text or char where it is.

The picture stays as it is, and GetState() is State::kReady; ShiftTask() takes no step until the next shift starts. Without a shift, it does nothing.

◆ Update()

void max_matrix::Matrix::Update ( )
inlineinherited

Sends what was drawn since the last update.

Only needed with auto update off; see Batch.


The documentation for this class was generated from the following file: