|
MAX7219_CH32 Library 1.0.0
A lightweight library for controlling MAX7219 7-segment displays
|
Main class for controlling MAX7219 7-segment displays. More...
#include <MAX7219_CH32.h>
Public Member Functions | |
| MAX7219 (uint8_t dinPin, uint8_t clkPin, uint8_t csPin, uint8_t numDigits=8) | |
| Constructor for MAX7219 display. | |
| void | begin () |
| Initialize the display with default mode. | |
| void | begin (uint8_t mode) |
| Initialize the display with specific mode. | |
| void | setMode (uint8_t mode) |
| Set decode mode. | |
| uint8_t | getMode () |
| Get current mode. | |
| void | setAlignment (uint8_t alignment) |
| Set text alignment. | |
| uint8_t | getAlignment () |
| Get current alignment. | |
| void | setBrightness (uint8_t level) |
| Set display brightness. | |
| void | setPower (bool on) |
| Turn display on or off. | |
| void | clear () |
| Clear all digits. | |
| void | display (const char *text) |
| Display text string. | |
| void | display (int number) |
| Display integer. | |
| void | display (long number) |
| Display long number. | |
| void | display (double number, uint8_t decimals=2) |
| Display floating point number. | |
| void | displayAt (uint8_t position, uint8_t value, bool dp=false) |
| Display value at specific position. | |
| void | displayAt (uint8_t position, char character, bool dp=false) |
| Display character at specific position. | |
| void | displayTime (uint8_t hours, uint8_t minutes) |
| Display time in HH:MM format. | |
| void | displayTime (uint8_t hours, uint8_t minutes, uint8_t seconds) |
| Display time in HH:MM:SS format. | |
| void | displayHex (uint32_t value) |
| Display value in hexadecimal format. | |
| void | displayBinary (uint8_t value) |
| Display value in binary format. | |
| void | blink (uint8_t times=3, uint16_t delayMs=500) |
| Blink the display. | |
| void | fadeIn (uint16_t delayMs=50) |
| Fade in animation. | |
| void | fadeOut (uint16_t delayMs=50) |
| Fade out animation. | |
| void | scroll (const char *text, uint16_t delayMs=200) |
| Scroll text across display. | |
| void | scroll (long number, uint16_t delayMs=200) |
| Scroll number across display. | |
| void | chase (uint16_t delayMs=100) |
| Chase animation (digit-by-digit) | |
| void | countUp (long from, long to, uint16_t delayMs=100) |
| Count up animation. | |
| void | countDown (long from, long to, uint16_t delayMs=100) |
| Count down animation. | |
| void | setSegments (uint8_t position, uint8_t segments) |
| Set raw segment pattern at position. | |
| void | setRawDigit (uint8_t position, uint8_t value, bool dp=false) |
| Set raw digit value at position. | |
Main class for controlling MAX7219 7-segment displays.
Definition at line 63 of file MAX7219_CH32.h.
| MAX7219::MAX7219 | ( | uint8_t | dinPin, |
| uint8_t | clkPin, | ||
| uint8_t | csPin, | ||
| uint8_t | numDigits = 8 ) |
Constructor for MAX7219 display.
| dinPin | Data input pin (MOSI) |
| clkPin | Clock pin (SCK) |
| csPin | Chip select pin (CS/SS) |
| numDigits | Number of digits (1-8, default: 8) |
Definition at line 91 of file MAX7219_CH32.cpp.
| void MAX7219::begin | ( | ) |
Initialize the display with default mode.
Definition at line 104 of file MAX7219_CH32.cpp.
| void MAX7219::begin | ( | uint8_t | mode | ) |
Initialize the display with specific mode.
| mode | Display mode (MAX7219_MODE_DECODE or MAX7219_MODE_NO_DECODE) |
Definition at line 108 of file MAX7219_CH32.cpp.
| void MAX7219::blink | ( | uint8_t | times = 3, |
| uint16_t | delayMs = 500 ) |
Blink the display.
| times | Number of blinks (default: 3) |
| delayMs | Delay between blinks in milliseconds (default: 500) |
Definition at line 325 of file MAX7219_CH32.cpp.
| void MAX7219::chase | ( | uint16_t | delayMs = 100 | ) |
Chase animation (digit-by-digit)
| delayMs | Delay between steps in milliseconds (default: 100) |
Definition at line 375 of file MAX7219_CH32.cpp.
| void MAX7219::clear | ( | ) |
Clear all digits.
Definition at line 160 of file MAX7219_CH32.cpp.
| void MAX7219::countDown | ( | long | from, |
| long | to, | ||
| uint16_t | delayMs = 100 ) |
Count down animation.
| from | Starting value |
| to | Ending value |
| delayMs | Delay between counts in milliseconds (default: 100) |
Definition at line 398 of file MAX7219_CH32.cpp.
| void MAX7219::countUp | ( | long | from, |
| long | to, | ||
| uint16_t | delayMs = 100 ) |
Count up animation.
| from | Starting value |
| to | Ending value |
| delayMs | Delay between counts in milliseconds (default: 100) |
Definition at line 389 of file MAX7219_CH32.cpp.
| void MAX7219::display | ( | const char * | text | ) |
Display text string.
| text | Text to display (null-terminated string) |
Definition at line 173 of file MAX7219_CH32.cpp.
| void MAX7219::display | ( | double | number, |
| uint8_t | decimals = 2 ) |
Display floating point number.
| number | Floating point value to display |
| decimals | Number of decimal places (default: 2) |
Definition at line 192 of file MAX7219_CH32.cpp.
| void MAX7219::display | ( | int | number | ) |
Display integer.
| number | Integer value to display |
Definition at line 184 of file MAX7219_CH32.cpp.
| void MAX7219::display | ( | long | number | ) |
Display long number.
| number | Long value to display |
Definition at line 188 of file MAX7219_CH32.cpp.
| void MAX7219::displayAt | ( | uint8_t | position, |
| char | character, | ||
| bool | dp = false ) |
Display character at specific position.
| position | Digit position (0-based) |
| character | Character to display |
| dp | true to show decimal point (default: false) |
Definition at line 214 of file MAX7219_CH32.cpp.
| void MAX7219::displayAt | ( | uint8_t | position, |
| uint8_t | value, | ||
| bool | dp = false ) |
Display value at specific position.
| position | Digit position (0-based) |
| value | Numeric value (0-9) |
| dp | true to show decimal point (default: false) |
Definition at line 196 of file MAX7219_CH32.cpp.
| void MAX7219::displayBinary | ( | uint8_t | value | ) |
Display value in binary format.
| value | Value to display in binary (requires 8 digits) |
Definition at line 313 of file MAX7219_CH32.cpp.
| void MAX7219::displayHex | ( | uint32_t | value | ) |
Display value in hexadecimal format.
| value | Value to display in hex |
Definition at line 286 of file MAX7219_CH32.cpp.
| void MAX7219::displayTime | ( | uint8_t | hours, |
| uint8_t | minutes ) |
Display time in HH:MM format.
| hours | Hours (0-99) |
| minutes | Minutes (0-59) |
Definition at line 241 of file MAX7219_CH32.cpp.
| void MAX7219::displayTime | ( | uint8_t | hours, |
| uint8_t | minutes, | ||
| uint8_t | seconds ) |
Display time in HH:MM:SS format.
| hours | Hours (0-99) |
| minutes | Minutes (0-59) |
| seconds | Seconds (0-59) |
Definition at line 262 of file MAX7219_CH32.cpp.
| void MAX7219::fadeIn | ( | uint16_t | delayMs = 50 | ) |
Fade in animation.
| delayMs | Delay between brightness steps in milliseconds (default: 50) |
Definition at line 334 of file MAX7219_CH32.cpp.
| void MAX7219::fadeOut | ( | uint16_t | delayMs = 50 | ) |
Fade out animation.
| delayMs | Delay between brightness steps in milliseconds (default: 50) |
Definition at line 343 of file MAX7219_CH32.cpp.
| uint8_t MAX7219::getAlignment | ( | ) |
Get current alignment.
Definition at line 147 of file MAX7219_CH32.cpp.
| uint8_t MAX7219::getMode | ( | ) |
| void MAX7219::scroll | ( | const char * | text, |
| uint16_t | delayMs = 200 ) |
Scroll text across display.
| text | Text to scroll |
| delayMs | Delay between scroll steps in milliseconds (default: 200) |
Definition at line 352 of file MAX7219_CH32.cpp.
| void MAX7219::scroll | ( | long | number, |
| uint16_t | delayMs = 200 ) |
Scroll number across display.
| number | Number to scroll |
| delayMs | Delay between scroll steps in milliseconds (default: 200) |
Definition at line 369 of file MAX7219_CH32.cpp.
| void MAX7219::setAlignment | ( | uint8_t | alignment | ) |
Set text alignment.
| alignment | Alignment mode (MAX7219_ALIGN_LEFT, MAX7219_ALIGN_RIGHT, or MAX7219_ALIGN_CENTER) |
Definition at line 143 of file MAX7219_CH32.cpp.
| void MAX7219::setBrightness | ( | uint8_t | level | ) |
Set display brightness.
| level | Brightness level (0-15, where 0 is dimmest and 15 is brightest) |
Definition at line 151 of file MAX7219_CH32.cpp.
| void MAX7219::setMode | ( | uint8_t | mode | ) |
Set decode mode.
| mode | Display mode (MAX7219_MODE_DECODE or MAX7219_MODE_NO_DECODE) |
Definition at line 133 of file MAX7219_CH32.cpp.
| void MAX7219::setPower | ( | bool | on | ) |
Turn display on or off.
| on | true to turn on, false to turn off |
Definition at line 156 of file MAX7219_CH32.cpp.
| void MAX7219::setRawDigit | ( | uint8_t | position, |
| uint8_t | value, | ||
| bool | dp = false ) |
Set raw digit value at position.
| position | Digit position (0-based) |
| value | Raw digit value |
| dp | true to show decimal point (default: false) |
Definition at line 416 of file MAX7219_CH32.cpp.
| void MAX7219::setSegments | ( | uint8_t | position, |
| uint8_t | segments ) |
Set raw segment pattern at position.
| position | Digit position (0-based) |
| segments | Bit pattern for segments (DP-A-B-C-D-E-F-G) |
Definition at line 410 of file MAX7219_CH32.cpp.