Difference between revisions of "Sensor-Dot Matrix-Color"

From Microduino Wiki
Jump to: navigation, search
(Dot Matrix Library Specification)
Line 4: Line 4:
 
|
 
|
 
[[file:Dot Matrixfront.jpg|thumb|400px|right]]
 
[[file:Dot Matrixfront.jpg|thumb|400px|right]]
Sensor-Dot Matrix module is a 8x8 multi-color LED displaying matrix module, which can be used singly or multiply (combined into different shapes),  which is used to display pictures or texts, or even simple animation.
+
The product number of Microduino-Dot Matrix is: '''MSDL31'''
 +
 
 +
Microduino-Dot Matrix is a 8x8 colorful LED displaying dot matrix module, which can be used singly or by the cascade of multiple(combine into different shapes), to display text or images, or even simple animation.  
 +
 
 
==Features==
 
==Features==
 +
*8x8 dot matrix, the size is 60mm*60mm
 +
*The display quality of the color of each point is 15-level, three RGB primary colors are 32-grade adjustable, and the whole is 32k-color to display.
 +
*Supports IIC communication protocol, the IIC address is settable(1~64), and the dot matrix sequence adopts rectangular plane coordinate system.
 +
*With 2 IIC interfaces onboard, which make the cascade of multiple dot matrix easy.
 +
 +
==Specification==
 +
*Sensor voltage
 +
**5V working voltage
 +
*Sensor current
 +
**300mA at most
  
*8x8 dot matrix, and the size is 60mm*60mm;
+
*Sensor size
*The display quality of the color of each point is 15-bit, and the RGB tricolor 32-level adjustment, and integral 32k colour color display effect;
+
**Size of the board: 60mm*60mm
*Support IIC communication protocol, and the IIC address can be set(1~64). THe dot matrix sequence adopts plane rectangular coordinate system, whcih is easy to control;
+
**1.27mm-spacing 4Pin interface connected with sensorhub
*With 2 IIC interfaces onboard, which makes the cascade between multiple dot matrixes easy;
 
*With one I/O port which can flexibly control the color of each lamp bead; 
 
*Open-source hardware circuit design and Arduino-compatible programming development environment;
 
*With unified Microduino interface specification and abundant peripheral modules, which make it can be quickly extended and connected with other modules and sensors meeting the Microduino interface specification, conveniently and flexibly; 
 
  
 +
*Function description
 +
**8x8 dot matrix
 +
**The display quality of the color of each point is 15-level, three RGB primary colors are 32-grade adjustable, and the whole is 32k-color to display.
 +
**Supports IIC communication protocol, the IIC address is settable(1~64), and the dot matrix sequence adopts rectangular plane coordinate system.
 +
**With 2 IIC interfaces onboard, which make the cascade of multiple dot matrix easy.
  
==Specification==
+
*Connection
*Electrical specification
+
**This sensor can be connected to the I2C interface of the core.
**Working voltage: 5V
+
**The cascade of multiple sensors is supported, 64 at most.  
**Working current: maximum 300mA
 
**IIC communication speed: 400Kbps
 
*Display quality
 
**Three primary colors gray: 32-level adjustable
 
**Size of single point: 6mm*6mm
 
*Control
 
**Set IIC address(1~64) through the buttons on the back of the module, and the method is as following.
 
  
==Document==
+
==Documents==
Eagle PCB:
+
*Schematic diagram: [[File:Dot Matrix-Color PCB]]
Download: http://pan.baidu.com/s/1nuuTv8P
+
*You can experiment with the sample programs in the following IDE libraries on your own : [https://github.com/wasdpkj/Microduino-IDE-Support/tree/master/arduino-ide-Support/%5B1.6.x%5D-hardware(library)/hardware/Microduino/avr/libraries '''_01_Microduino_DotMatrix''']
===Main Component===
 
*Wiki for WS2812: http://wiki.hacdc.org/index.php/WS2811_Digital_RGB_LED#Individual_LEDs
 
  
 
==Development==
 
==Development==
 +
===Program Download===
 +
*Download and unzip the program '''[[File:Dot Matrix-Color.zip]]'''
 +
===Programming===
 +
{{Upload
 +
|nameA=[[Microduino-Core]], [[Microduino-USBTTL]]
 +
|nameB=[[Microduino-USBTTL]]
 +
|boardName=Microduino/mCookie-Core(328p), Atmega328P@16M,5V
 +
|fileName=Dot Matrix-Color.ino
 +
}}
 +
 +
===Hardware Setup===
 +
*Referring to the following diagram, connect the Sensor-Dot Matrix-Color to the port I2C of '''[[Microduino-Sensorhub]]'''.
 +
<br>
 +
[[file:Microduino-sensorhub_I2C.JPG|thumb|400px|left]]
 +
<br style="clear: left"/>
 +
 +
===Method to Set the Address of the Dot Matrix===
 +
*The range of the address of the dot matrix is 1~64.
 +
*After being powered, the number of the green points displayed on the dot matrix represents the address of the dot matrix.
 +
*During '''3s''' after the dot matrix is powered, '''pressing the button on the back''' can enter address configuration state, and at this time, the dot matrix changes into white.
 +
**Pressing the button slowly (the interval is larger than 0.5s)will add the address
 +
**Pressing the button quickly(the interval is less than 0.5s)will reduce the address
 +
*After setting the address, long press the button for 3s, to exit the address configuration state.
 +
 +
==Introduction of the Code==
 +
*Define the IIC address single dot matrix
 +
  uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //1x1
 +
    { 64}
 +
  };
 +
 +
*Define the IIC address of 2x2 cascade dot matrix.
 +
  uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //2x2
 +
    { 64, 63},
 +
    { 62, 61}
 +
  };
 +
 +
*Define the IIC address of 1x4 cascade dot matrix.
 +
  uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //1x4
 +
    { 64, 63, 62 , 61}
 +
  };
  
===Set Method of the Address of Dot Matrix===
+
*Get the number of devices which have already been connected.
*Check the address of the dot matrix:
+
  int16_t getMatrixNum()
**After the Sensor -Dot Matrix is powered on, during the initial 3s, it is in a state of IIC address initialization.
 
**At this time, the dot matrix will display green points of which the number represents the address value of the current dot matrix. If you haven’t pressed the setting button down during this 3s, the dot matrix will enter working state, and the IIC address of the dot matrix is that displayed. At this time, the display state of the dot matrix can be controlled by IIC.
 
*Enter dot matrix address setting state:
 
After the module Sensor-Dot Matrix is powered on, press the setting button down within the 3s of IIC address initialization, and the green points representing the address value will change into white, which says it has entered the address setting state.
 
*Change the address of the dot matrix:
 
*After enter the address setting state, press the button down, and the address will be changed. The range of the address is 1~64(the white representing the address value will change along with it).
 
**Pressing the button slowly(the interval between 2 times of pressing the button is greater than 0.5s) will add the address;
 
**Pressing the button quickly (the interval is less than 0.5s) will reduce the address.
 
*Exit the dot matrix setting state:
 
*After adjust the dot matrix to the required set value, long press the button, after 8s, the white points representing the address value will die out, and it exit the address setting state, entering working state. The IIC address at this time is the set address.
 
===Arduino Library and Support Package===
 
*Adopt adafruit_NeoPixel library file:
 
**Adafruit_NeoPixel:https://github.com/adafruit/Adafruit_NeoPixel
 
  
==Application==
+
*Get the IIC address of devices which have already been connected.
===Dot Matrix Library Specification===
+
  getDeviceAddr(_a) //num
For the introduction of the code, please refer to[https://wiki.microduino.cc/index.php/Open_Source_LED_Dot_Matrix_Screen '''Dot Matrix Screen Code Introduction''']
+
 
 +
*Get the number of the dot matrix on X axis.
 +
  getWidth()
 +
 
 +
*Get the number of the dot matrix on Y axis.
 +
  getHeight()
 +
 
 +
*Set the on or off of the dot matrix coordinate pixel.
 +
  setLed(_row, _col, _state) //row, col, state
 +
 
 +
*Set the color of the dot matrix coordinate pixel.
 +
  setLedColor(_row, _col, _r, _g, _b) //row, col, red, green ,blue
 +
 
 +
*Clear the screen.
 +
  clearDisplay()
 +
 
 +
*Set the color of the dot matrix.
 +
  setColor(_r, _g, _b) //red, green ,blue
 +
 
 +
*The characters are displayed flowingly.
 +
  writeString(_c, _t, _col) //[char*], time, col
 +
 
 +
*Hex bitmap display
 +
  drawBMP(_row, _col , _w, _h, logo) //row, col, width, height, file
 +
 
 +
*BMP display(you can refer to [https://www.microduino.cn/wiki/index.php/Microduino%E7%82%B9%E9%98%B5%E6%A8%A1%E5%9D%97%E6%98%BE%E7%A4%BABMP%E5%BD%A9%E5%9B%BE ''' The dot matrix module displays BMP color map''']
 +
  drawBMP(_row, _col, logo) //row, col, file
 +
 
 +
*Use function to draw a solid rectangle
 +
  drawBox(_row, _col, _w, _h) //row, col, width, height
 +
 
 +
*Draw a solid rounded rectangle.
 +
  drawRBox(_row, _col, _w, _h, _r) //row, col, width, height, rad
 +
 
 +
*Draw a hollow rectangle
 +
  drawFrame(_row, _col, _w, _h) //row, col, width, height
 +
 
 +
*Draw a rounded hollow rounded rectangle
 +
  drawRFrame(_row, _col, _w, _h, _r) //row, col, width, height, rad
 +
 
 +
*Draw a hollow circle.
 +
  drawCircle(_row, _col, _r) //row, col, rad
 +
 
 +
*To draw a solid circle
 +
  drawDisc(_row, _col, _r) //row, col, rad
  
==Purchase==
+
*To draw a straight line
 +
  drawLine(_row, _col, _row1, _col1) //row start, col start, row end, col end
  
 +
==Application==
 +
*'''[[Open Source LED Dot Matrix Screen]]'''
 +
*'''[[Open Source LED Dot Matrix Clock]]'''
  
 
==Gallery==
 
==Gallery==
 
[[file:Microduino-DotMatrix-F.jpg|thumb|600px|center|Front]]
 
[[file:Microduino-DotMatrix-F.jpg|thumb|600px|center|Front]]
 
[[file:Microduino-DotMatrix-B.jpg|thumb|600px|center|Back]]
 
[[file:Microduino-DotMatrix-B.jpg|thumb|600px|center|Back]]

Revision as of 03:28, 19 September 2016

Language: English  • 中文
Dot Matrixfront.jpg

The product number of Microduino-Dot Matrix is: MSDL31

Microduino-Dot Matrix is a 8x8 colorful LED displaying dot matrix module, which can be used singly or by the cascade of multiple(combine into different shapes), to display text or images, or even simple animation.

Features

  • 8x8 dot matrix, the size is 60mm*60mm
  • The display quality of the color of each point is 15-level, three RGB primary colors are 32-grade adjustable, and the whole is 32k-color to display.
  • Supports IIC communication protocol, the IIC address is settable(1~64), and the dot matrix sequence adopts rectangular plane coordinate system.
  • With 2 IIC interfaces onboard, which make the cascade of multiple dot matrix easy.

Specification

  • Sensor voltage
    • 5V working voltage
  • Sensor current
    • 300mA at most
  • Sensor size
    • Size of the board: 60mm*60mm
    • 1.27mm-spacing 4Pin interface connected with sensorhub
  • Function description
    • 8x8 dot matrix
    • The display quality of the color of each point is 15-level, three RGB primary colors are 32-grade adjustable, and the whole is 32k-color to display.
    • Supports IIC communication protocol, the IIC address is settable(1~64), and the dot matrix sequence adopts rectangular plane coordinate system.
    • With 2 IIC interfaces onboard, which make the cascade of multiple dot matrix easy.
  • Connection
    • This sensor can be connected to the I2C interface of the core.
    • The cascade of multiple sensors is supported, 64 at most.

Documents

Development

Program Download

Programming

  • Follow the Software Getting Started Guide.
  • Select the Board, Processor and Port.
  • Click [File]->[Open], browse to the project program address, and click "Dot Matrix-Color.ino" to open the program.
  • After confirming all these items are correct, click "→" to download the program to the development board.

Hardware Setup

  • Referring to the following diagram, connect the Sensor-Dot Matrix-Color to the port I2C of Microduino-Sensorhub.


Microduino-sensorhub I2C.JPG


Method to Set the Address of the Dot Matrix

  • The range of the address of the dot matrix is 1~64.
  • After being powered, the number of the green points displayed on the dot matrix represents the address of the dot matrix.
  • During 3s after the dot matrix is powered, pressing the button on the back can enter address configuration state, and at this time, the dot matrix changes into white.
    • Pressing the button slowly (the interval is larger than 0.5s)will add the address
    • Pressing the button quickly(the interval is less than 0.5s)will reduce the address
  • After setting the address, long press the button for 3s, to exit the address configuration state.

Introduction of the Code

  • Define the IIC address single dot matrix
 uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //1x1
   { 64}
 };
  • Define the IIC address of 2x2 cascade dot matrix.
 uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //2x2
   { 64, 63},
   { 62, 61}
 };
  • Define the IIC address of 1x4 cascade dot matrix.
 uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //1x4
   { 64, 63, 62 , 61}
 };
  • Get the number of devices which have already been connected.
 int16_t getMatrixNum()
  • Get the IIC address of devices which have already been connected.
 getDeviceAddr(_a)				//num
  • Get the number of the dot matrix on X axis.
 getWidth()
  • Get the number of the dot matrix on Y axis.
 getHeight()
  • Set the on or off of the dot matrix coordinate pixel.
 setLed(_row, _col, _state)			//row, col, state
  • Set the color of the dot matrix coordinate pixel.
 setLedColor(_row, _col, _r, _g, _b)	//row, col, red, green ,blue
  • Clear the screen.
 clearDisplay()
  • Set the color of the dot matrix.
 setColor(_r, _g, _b)				//red, green ,blue
  • The characters are displayed flowingly.
 writeString(_c, _t, _col)			//[char*], time, col
  • Hex bitmap display
 drawBMP(_row, _col , _w, _h, logo)		//row, col, width, height, file
 drawBMP(_row, _col, logo)			//row, col, file
  • Use function to draw a solid rectangle
 drawBox(_row, _col, _w, _h)			//row, col, width, height
  • Draw a solid rounded rectangle.
 drawRBox(_row, _col, _w, _h, _r)		//row, col, width, height, rad
  • Draw a hollow rectangle
 drawFrame(_row, _col, _w, _h)		//row, col, width, height
  • Draw a rounded hollow rounded rectangle
 drawRFrame(_row, _col, _w, _h, _r)		//row, col, width, height, rad
  • Draw a hollow circle.
 drawCircle(_row, _col, _r)			//row, col, rad
  • To draw a solid circle
 drawDisc(_row, _col, _r)			//row, col, rad
  • To draw a straight line
 drawLine(_row, _col, _row1, _col1)		//row start, col start, row end, col end

Application

Gallery

Front
Back