p kj
/
LPC824-DotMatrix
Microduino
Fork of LED_DZ by
Diff: Microduino_Matrix.cpp
- Revision:
- 1:14b7c3a3ec60
- Parent:
- 0:5ca227682ee7
- Child:
- 2:487a727d6181
--- a/Microduino_Matrix.cpp Tue May 31 15:32:03 2016 +0000 +++ b/Microduino_Matrix.cpp Wed Jun 01 13:38:30 2016 +0000 @@ -82,21 +82,18 @@ return led[_a].getDeviceAddr(); } - void Matrix::setDeviceAddr(uint8_t* _addr) { for (int a = 0; a < getMatrixNum(); a++) led[a].setDeviceAddr(_addr[a]); } - void Matrix::clearDisplay() { for (int a = 0; a < getMatrixNum(); a++) led[a].clearDisplay(); } - void Matrix::setLedColor(uint8_t _row, uint8_t _col, uint8_t _value_r, uint8_t _value_g, uint8_t _value_b) { if((_col > (getHeight() * 8 - 1)) || (_row > (getWidth() * 8 - 1))) @@ -105,7 +102,6 @@ led[_s].setLedColor(_row % 8, _col % 8, _value_r, _value_g, _value_b); } - void Matrix::setLedColorFast(uint8_t _row, uint8_t _col, uint8_t _value_r, uint8_t _value_g, uint8_t _value_b) { if((_col > (getHeight() * 8 - 1)) || (_row > (getWidth() * 8 - 1))) @@ -122,7 +118,6 @@ led[_s].setLed(_row % 8, _col % 8, _state); } - void Matrix::setCursor(int16_t _x, int16_t _y) { this->cursor_x = _x; @@ -136,7 +131,6 @@ } } - void Matrix::setFastMode() { // runFun(&setFastMode); @@ -145,7 +139,6 @@ led[a].setFastMode(); } - void Matrix::clearFastMode() { // this->Fast_mode = false; @@ -153,28 +146,24 @@ led[a].clearFastMode(); } - void Matrix::setFontMode(bool _Mode) { for (int a = 0; a < getMatrixNum(); a++) led[a].setFontMode(_Mode); } - void Matrix::setColor(uint8_t value_r, uint8_t value_g, uint8_t value_b) { for (int a = 0; a < getMatrixNum(); a++) led[a].setColor(value_r, value_g, value_b); } - void Matrix::clearColor() { for (int a = 0; a < getMatrixNum(); a++) led[a].clearColor(); } - void Matrix::drawLine(int8_t x1, int8_t y1, int8_t x2, int8_t y2) { uint8_t tmp; @@ -229,7 +218,6 @@ } } - void Matrix::drawCircle_section(int8_t x, int8_t y, int8_t x0, int8_t y0, uint8_t option) { /* upper right */ @@ -257,7 +245,6 @@ } } - void Matrix::drawVLine(int8_t x, int8_t y, int8_t w) { if(w<=0) @@ -268,7 +255,6 @@ } } - void Matrix::drawHLine(int8_t x, int8_t y, int8_t h) { if(h<=0) @@ -279,7 +265,6 @@ } } - void Matrix::drawDisc_section(int8_t x, int8_t y, int8_t x0, int8_t y0, uint8_t option) { /* upper right */ @@ -307,7 +292,6 @@ } } - void Matrix::drawCircle(int8_t x0, int8_t y0, int8_t rad, int8_t option) { if(rad<=0) @@ -344,7 +328,6 @@ } } - void Matrix::drawDisc(int8_t x0, int8_t y0, int8_t rad, int8_t option) { if(rad<=0) @@ -381,7 +364,6 @@ } } - void Matrix::drawFrame(int8_t x, int8_t y, int8_t w, int8_t h) { if(h<=0 || w<=0) @@ -399,7 +381,6 @@ drawHLine(xtmp, y, w); } - void Matrix::drawRFrame(int8_t x, int8_t y, int8_t w, int8_t h, uint8_t r) { if(h<3 || w<3) @@ -456,7 +437,6 @@ } } - void Matrix::drawBox(int8_t x, int8_t y, int8_t w, int8_t h) { if(h<=0 || w<=0) @@ -469,7 +449,6 @@ } while( h != 0 ); } - void Matrix::drawRBox(int8_t x, int8_t y, int8_t w, int8_t h, uint8_t r) { if(h<3 || w<3) @@ -525,7 +504,6 @@ } } - void Matrix::drawBMP(int16_t x, int16_t y, int16_t w, int16_t h,const uint8_t *bitmap) { int16_t i, j, byteWidth = (w + 7) / 8; @@ -545,7 +523,6 @@ } } - bool Matrix::drawBMP(int16_t x, int16_t y, const uint8_t *bitmap) { uint32_t _dataNum = 0; @@ -651,7 +628,7 @@ int _Width = 0; while (_String[_leng] != NULL) { #if 0 - _Width += 1 + pgm_read_byte(alphabetBitmap[((int)_String[_leng] - 32)] + FONE_SIZE_X); + _Width += 1 + pgm_read_byte(alphabetBitmap[(_String[_leng] - 32)] + FONE_SIZE_X); #else //_Width += (1 + alphabetBitmap[((int)_String[_leng] - 32)] + FONE_SIZE_X); _Width += 1 + FONE_SIZE_X;