MAX7SegmentDisplay is an Arduino library for MAX7219 and MAX7221 8 bit 7-segment digital LED display module drivers.
Or you can copy DigitLedDisplay library to -> arduino\libraries\
Start From Digit: Default Value Zero
max.printDigit(1234);

Start From Digit 4
digitLedDisplay.printDigit(1234, 4);

Image credit: the images above are from the original library by Ozhan Duran and are used here with attribution.
#include <MAX7SegmentDisplay.h>
// initialize with pin numbers for data, cs, and clock
MAX7SegmentDisplay max = MAX7SegmentDisplay(11, 8, 13);
void setup() {
max.setBright(15); // range is 0-15
max.setDigitLimit(8);
}
long i = 12345678;
void loop() {
max.printDigit(i++);
delay(10);
}For additional features see Digit7SegmentDemo.ino
This library supports reversing the order in which digits are written to the display.
-
setReverseDirection(bool rev)
- Call with
trueto enable reverse printing,falseto restore normal order. - Example:
max.setReverseDirection(true); max.printDigit(1234);— the digits will be sent in reverse order.
- Call with
-
ReverseDirection()
- Compatibility helper (older API). Calling
max.ReverseDirection()will enable reverse mode (equivalent tosetReverseDirection(true)).
- Compatibility helper (older API). Calling
Note: Reverse mode affects only the order the library writes digit values to the MAX chip; it does not change wiring or physical orientation of the module. Use setReverseDirection(false) to return to the default behavior.