项目作者: Reiter86

项目描述 :
The MAX7219 library to use 8x8 LED matrix module or 8x 7-segment module with arduino or other MCU's
高级语言: C
项目地址: git://github.com/Reiter86/MAX7219.git
创建时间: 2019-07-13T18:38:54Z
项目社区:https://github.com/Reiter86/MAX7219

开源协议:

下载


MAX7219 - LED-MATRIX - 7Segment

Travis (.com)
GitHub release
GitHub code size in bytes
GitHub All Releases

The MAX7219 library can be used for a 8x8 LED matrix module or 8x 7-segment module.
The library uses the orginal SPI library from the Arduino IDE.


Connecting an MCU to a Modul

These instructions are for all MCU’s.

MCU MAX7219 (LED Matrix-7Segment) - Modul
VCC VCC
GND GND
SCK CLK
MOSI DIN
SS CS


Installing the Library

To install the library into your IDE:

  • click on the Clone or Download button on this Github page and select Download ZIP.
  • Start the Arduino IDE and from the Sketch menu do Sketch->Include Library->Add ZIP Library and select the ZIP you just downloaded.


API Reference

This is a very easy library to use. You may just wish to try out the examples, that send a bitmessage from the MCU to the MAX7219 using the SPI. But for completeness, here it is:


Matrix-8x8-Modul

You can use a maximum 8 8x8Matrix fields.

Table of Functions



Include File

Include the the library.

  1. #include <MAX7219.h>

Initialisation

Initialize the library with an object from Matrix8x8 from the Namespace MAX7219.

  1. MAX7219::Segment myMatrix

" class="reference-link">setIntensity

Set the brightness of the module.

  1. myMatrix.setIntensity(uint8_t _intensity=1);

_intensity brightness of segments / from 1 to 15


" class="reference-link">writeByte

Writes a byte in the layout

  1. myMatrix.writeByte(uint64_t _byte, int8_t _row=0, int8_t _shift=0, int8_t _invert=0);

_byte set the value of one byte

_row set the row from the byte / from 0 to 7

_shift shift the byte by _shift columns

_invert inverse the byte / 0=not inverse or 1=inverse


" class="reference-link">writeArray

Writes a array in the layout

  1. myMatrix.writeArray(char * _array, int8_t _shift=0, char _inversetion='n', int8_t _invert=0, uint8_t _offset=0);

_array array[8][8]

_shift shift the array by _shift columns

_inversetion Turn the array in the _inversetion direction / n=normal, r=right,l=left,h=headsup

_invert inverse the array / 0=not inverse or 1=inverse

_offset change direction / runns 1=right to left or 0=left to right


" class="reference-link">writeChar

Write an ASCII-sign in the layout

  1. myMatrix.writeChar(char _char, int8_t _shift=0, char _inversetion='n', int8_t _invert=0, uint8_t _offset=0);

_array char string

_shift shift the char by _shift columns

_inversetion Turn the char in the _inversetion direction / n=normal, r=right,l=left,h=headsup

_invert inverse the char / 0=not inverse or 1=inverse

_offset move up by _offset raws


" class="reference-link">printScrollText

Write a string which runs over the display

  1. myMatrix.printScrollText(char * _text, uint8_t _speed=80, int8_t _invert=0);

_text char string

_speed speed auf the running text

_invert change direction / runs 1=right to left or 0=left to right


" class="reference-link">blankDisplay

Set all 8x8 fields blank.

  1. myMatrix.blankDisplay();

" class="reference-link">printDisplay

Print/Show the inserted arrays of characters and bytes.

  1. myMatrix.printDisplay();
  2. `


7-Segment Modul x8

You can use a maximum of 8 digits (including comma).

Table of Functions



Include File

Include the the library.

  1. #include <MAX7219.h>

Initialisation

Initialize the library with an object from Segment from the Namespace MAX7219.

  1. MAX7219::Segment mySegment

" class="reference-link">setIntensity

Set the brightness of the module.

  1. mySegment.setIntensity(uint8_t _intensity=1);

_intensity brightness of segments / from 1 to 15


" class="reference-link">printNumber

Print/Show the number with definded decimals on the segments.

  1. mySegment.printNumber(double _number, uint8_t _decimals=0);

_number number to show on the segments

_decimals number of decimal places displayed on the segments


" class="reference-link">blankDisplay

Set all digits blank.

  1. mySegment.blankDisplay();