Shield MaTrix V0.9b

Shield MaTrix is a stackable Shield for Arduino, which makes it possible to learn programming using the most simple sensors on board.

Model: 830069001

Feature

Application Ideas

The principle of data display

To display different information on the LED matrix display uses dynamic . At the same time information is displayed only one line ( corresponding LED lights (red and (or ) green ) ) , all other lines - repaid. The next step - the previous line is extinguished and ignited the next line ( for her current LEDs). Switching rows is very fast and eyes perceive this switch as a single image .

To minimize the number of pins involved are two different types of chips: the shift registers (used for control columns) and a demultiplexer ( control lines).

Shift registers included chain and connected via SPI ( pins involved are described below).

Demultiplexer has three address inputs (DA0, DA1, DA2) - a combination of "0" and "1" at the entrances clearly points to one of the 8 outputs, which will be active level . Additionally the demultiplexer has control inputs (E1, E2, E3) - with the first two (E1 and E2, they are connected in our scheme ) organized a complete quenching of the matrix , and with the input E3 - organized brightness adjustment (using PWM) .

Interfaces

Pins on the board, involved on Arduino Mega:

Cautions

Schematic

The right side of the board (when viewed from the matrix) are:

On the left side of the board are:

Schematic of the device

Necessary libraries

To use the various components Shield MaTrix requires the following libraries:

Displays information on the matrix - MaTrix - MaTrix (including a simple display test and two real time display sketches.)


Additionally required libraries that are used during operation of libraries:

Features using libraries

Only two libraries require little comment on their use:

IR receiver

Since the IR receiver connected to digital pin of 5 must file / IRremote / IRremoteInt.h correct code as follows:

...

// Arduino Mega
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  //#define IR_USE_TIMER1   // tx = pin 11
  //#define IR_USE_TIMER2     // tx = pin 9
  #define IR_USE_TIMER3   // tx = pin 5
  //#define IR_USE_TIMER4   // tx = pin 6
  //#define IR_USE_TIMER5   // tx = pin 46

...

nRF24L01+

Initialize the module as follows:

...

//iBoardRF24 radio(CE,CSN,MOSI,MISO,SCK,IRQ);
iBoardRF24 radio(41,40,39,38,37,19);

...

Library functions MaTrix

To use the library in your sketch MaTrix need to declare a function void setup () to enter the following line of code:

 #include <SPI.h>
 #include <MaTrix.h>	//connection library MaTrix
 
 MaTrix mymatrix;       //object creation mymatrix

Variables

byte array[8][8] - main array. The data from this array is determined that the currently displayed on the LED matrix

 byte array[8][8] = { // An array of 64 bytes
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 7
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 6
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 5
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 4
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 3
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 2
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 1
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}   // строка 0
   // red3      green3      red2      green2      red1      green1       red0      green0
 };

Each bit corresponds to the corresponding LED in the matrix. 0 - LED "extinguished", 1 - LED "lit"


byte shadow[8][8] - additional ("shadow") array. Library functions used for organizing various effects and scrolling text (data from the shadow of the array for a particular effect rewritten the rule of the "shadow" of the array in the main).

 byte shadow[8][8] = { //An array of 64 bytes
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 7
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 6
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 5
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 4
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 3
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 2
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},  // строка 1
   {B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}   // строка 0
   // red3      green3      red2      green2      red1      green1       red0      green0
 };

Definitions

 // Color
 #define RED    0
 #define GREEN  1
 #define YELLOW 2
 // delay iteration in "drawing" effects (ms)
 #define VSLOW  500
 #define SLOW   150
 #define MID    100
 #define FAST   50
 #define VFAST  25
 // effects 
 #define FADE   4
 #define LEFT   3
 #define UP     1
 #define DOWN   2
 #define NONE   0
 // hardware data
 #define BRIGHT 44    // brightness (pin 44 - PWM)
 #define LightSENS A7 // light sensor

Main function

mymatrix.init();

Description: nitialization module.


mymatrix.clearLed();

Description:cleaning the display.


mymatrix.brightness(byte brightLevel);

Description: sets the display brightness.
brightLevel:brightness level (byte), a value of 255 - set to maximum brightness.


Example of use:

 mymatrix.brightness(177);


mymatrix.get Brightness();

Description: returns the current display brightness.

Example of use:

 Serial.println(mymatrix.getBrightness());


printString(String s, byte pos, byte color, unsigned char *Font, char effect, int speed);

Description: displays the specified string.
pos: starting position of the first character (byte). Counting from the right edge of the matrix, starting with 0.
color: color (byte). Three predefined values - RED, GREEN, YELLOW
*Font: a pointer to the font (unsigned char). Fonts available at the library: character - font5x8 (Latin), font6x8 (Latin and Cyrillic); digital - digit6x8bold, digit6x8future. Details about fonts, see the file fonts.c of the library archive MaTrix.
effect: the effect of the inscription (char). Available predefined values: LEFT, UP, DOWN (shift in the corresponding direction), FADE (manifestation), NONE (No effect - instantly). Default value - NONE.
speed: playback speed effect (int). Available predefined values: VSLOW, SLOW, MID, FAST, VFAST (from "very slow" to "very quickly"), default value - MID.

Example of use:

 mymatrix.printString("123", 3, GREEN, font6x8, UP, SLOW);


printRunningString(String s, byte color, unsigned char *Font, int speed);

Description: displays the defined "running" line.
color: color (byte). Three predefined values - RED, GREEN, YELLOW
*Font: a pointer to the font (unsigned char). Fonts available at the library: character - font5x8 (Latin), font6x8 (Latin and Cyrillic); digital - digit6x8bold, digit6x8future. Details about fonts, see the file fonts.c of the library archive MaTrix.
speed: playback speed effect (int). Available predefined values: VSLOW, SLOW, MID, FAST, VFAST (from "very slow" to "very quickly"), default value - MID.


Example of use:

 mymatrix.printRunningString("MaTrix test!", RED, font6x8, FAST);

Auxiliary functions

printArray();

Description: displays the serial port the current state of the main array (array).


printShadow();

Description: displays the serial port the current state of the "shadow" of the array (shadow).


printChar(unsigned char sym, byte pos, byte color);

Description: function changes the bulk (array)so that when displayed in the matrix in a predetermined position of the desired output color desired symbol.
pos:starting character position (byte). Counting from the right edge of the matrix, starting with 0.
color: color (byte). Three predefined values - RED, GREEN, YELLOW

Attention! Font that is used when calling the function must be defined using the setFont.


printCharShadow(unsigned char sym, byte pos, byte color);

Description: function similar printChar, but is subject to modification "shadow" array (shadow).


printStr(unsigned char *s, byte pos, byte color);

Description: function changes the bulk (array) so that when displayed on a matrix with a predetermined desired position of the array of characters displayed the color desired.
*s: a pointer to an array of characters (unsigned char).
pos: starting position of the first character (byte). Counting from the right edge of the matrix, starting with 0.
color: color (byte). Three predefined values - RED, GREEN, YELLOW

Attention! Font that is used when calling the function must be defined using the setFont.


printStrShadow(unsigned char *s, byte pos, byte color);

Description: function similar printChar, but is subject to modification "shadow" array (shadow).

References

Current version of the library MaTrix

Bill of Materials (BOM) /parts list

All the components used to produce the product.

FAQ

Please list your question here:

Support

If you have questions or other better design ideas,

Version Tracker

Revision Descriptions Release
0.9 Prototype 11.04.2013
0.9b Public version 27.10.2013

Bug Tracker

Bug Tracker is the place you can publish any bugs you think you might have found during use. Please write down what you have to say, your answers will help us improve our

products.

Additional Idea

The Additional Idea is the place to write your project ideas about this product, or other usages you've found. Or you can write them on Projects page.

Resources

How to buy

This product can be purchased:
China (shipping worldwide)
Seeed store
Russia
Devicter store

See Also

Other related products and resources.

Licensing

This documentation is licensed under the Creative Commons Attribution-ShareAlike License 3.0 Source code and libraries are

licensed under GPL/LGPL, see source code files for details.

External Links

Links to external webpages which provide more application ideas, documents/datasheet or software libraries

Copyright (c) 2008-2016 Seeed Development Limited (www.seeedstudio.com / www.seeed.cc)
This static html page was created from http://www.seeedstudio.com/wiki