Li Weiyi
/
LED_DZ
work fine
Microduino_MatrixBase.h@1:14b7c3a3ec60, 2016-06-01 (annotated)
- Committer:
- lixianyu
- Date:
- Wed Jun 01 13:38:30 2016 +0000
- Revision:
- 1:14b7c3a3ec60
- Parent:
- 0:5ca227682ee7
??????????0,0?????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lixianyu | 0:5ca227682ee7 | 1 | // 本作品采用知识共享 署名-非商业性使用-相同方式共享 3.0 未本地化版本 许可协议进行许可 |
lixianyu | 0:5ca227682ee7 | 2 | // 访问 http://creativecommons.org/licenses/by-nc-sa/3.0/ 查看该许可协议 |
lixianyu | 0:5ca227682ee7 | 3 | // ============== |
lixianyu | 0:5ca227682ee7 | 4 | |
lixianyu | 0:5ca227682ee7 | 5 | // 版权所有: |
lixianyu | 0:5ca227682ee7 | 6 | // @老潘orz wasdpkj@hotmail.com |
lixianyu | 0:5ca227682ee7 | 7 | // ============== |
lixianyu | 0:5ca227682ee7 | 8 | |
lixianyu | 0:5ca227682ee7 | 9 | // Microduino-IDE |
lixianyu | 0:5ca227682ee7 | 10 | // ============== |
lixianyu | 0:5ca227682ee7 | 11 | // Microduino Getting start: |
lixianyu | 0:5ca227682ee7 | 12 | // http://www.microduino.cc/download/ |
lixianyu | 0:5ca227682ee7 | 13 | |
lixianyu | 0:5ca227682ee7 | 14 | // Microduino IDE Support: |
lixianyu | 0:5ca227682ee7 | 15 | // https://github.com/wasdpkj/Microduino-IDE-Support/ |
lixianyu | 0:5ca227682ee7 | 16 | |
lixianyu | 0:5ca227682ee7 | 17 | // ============== |
lixianyu | 0:5ca227682ee7 | 18 | // Microduino wiki: |
lixianyu | 0:5ca227682ee7 | 19 | // http://wiki.microduino.cc |
lixianyu | 0:5ca227682ee7 | 20 | |
lixianyu | 0:5ca227682ee7 | 21 | // ============== |
lixianyu | 0:5ca227682ee7 | 22 | // E-mail: |
lixianyu | 0:5ca227682ee7 | 23 | // Kejia Pan |
lixianyu | 0:5ca227682ee7 | 24 | // pankejia@microduino.cc |
lixianyu | 0:5ca227682ee7 | 25 | |
lixianyu | 0:5ca227682ee7 | 26 | // ============== |
lixianyu | 0:5ca227682ee7 | 27 | // Weibo: |
lixianyu | 0:5ca227682ee7 | 28 | // @老潘orz |
lixianyu | 0:5ca227682ee7 | 29 | |
lixianyu | 0:5ca227682ee7 | 30 | #ifndef Microduino_Matrix_base_h |
lixianyu | 0:5ca227682ee7 | 31 | #define Microduino_Matrix_base_h |
lixianyu | 0:5ca227682ee7 | 32 | #if 0 |
lixianyu | 0:5ca227682ee7 | 33 | #if (ARDUINO >= 100) |
lixianyu | 0:5ca227682ee7 | 34 | #include "Arduino.h" |
lixianyu | 0:5ca227682ee7 | 35 | #include "Print.h" |
lixianyu | 0:5ca227682ee7 | 36 | #else |
lixianyu | 0:5ca227682ee7 | 37 | #include "WProgram.h" |
lixianyu | 0:5ca227682ee7 | 38 | #endif |
lixianyu | 0:5ca227682ee7 | 39 | #endif |
lixianyu | 0:5ca227682ee7 | 40 | #include "Fonts.h" |
lixianyu | 0:5ca227682ee7 | 41 | //#include <Wire.h> |
lixianyu | 0:5ca227682ee7 | 42 | //#include <avr/pgmspace.h> |
lixianyu | 0:5ca227682ee7 | 43 | #include "mbed.h" |
lixianyu | 0:5ca227682ee7 | 44 | #include "Printit.h" |
lixianyu | 0:5ca227682ee7 | 45 | |
lixianyu | 0:5ca227682ee7 | 46 | #define MatrixPix_X 8 |
lixianyu | 0:5ca227682ee7 | 47 | #define MatrixPix_Y 8 |
lixianyu | 0:5ca227682ee7 | 48 | |
lixianyu | 0:5ca227682ee7 | 49 | class LedControl : public Print |
lixianyu | 0:5ca227682ee7 | 50 | { |
lixianyu | 0:5ca227682ee7 | 51 | public: |
lixianyu | 0:5ca227682ee7 | 52 | LedControl(); |
lixianyu | 0:5ca227682ee7 | 53 | // LedControl(uint8_t _addr); |
lixianyu | 0:5ca227682ee7 | 54 | uint8_t getDeviceAddr(); |
lixianyu | 0:5ca227682ee7 | 55 | void setDeviceAddr(uint8_t _addr); |
lixianyu | 0:5ca227682ee7 | 56 | |
lixianyu | 0:5ca227682ee7 | 57 | void clearDisplay(); |
lixianyu | 0:5ca227682ee7 | 58 | |
lixianyu | 0:5ca227682ee7 | 59 | void setColor(uint8_t value_r, uint8_t value_g, uint8_t value_b); |
lixianyu | 0:5ca227682ee7 | 60 | void clearColor(); |
lixianyu | 0:5ca227682ee7 | 61 | |
lixianyu | 0:5ca227682ee7 | 62 | void setFontMode(bool _Mode); |
lixianyu | 0:5ca227682ee7 | 63 | |
lixianyu | 0:5ca227682ee7 | 64 | void setLed(uint8_t row, uint8_t column, bool state); |
lixianyu | 0:5ca227682ee7 | 65 | void setLedColor(uint8_t row, uint8_t column, uint8_t value_r, uint8_t value_g, uint8_t value_b); |
lixianyu | 0:5ca227682ee7 | 66 | void setLedColorFast(uint8_t row, uint8_t column, uint8_t value_r, uint8_t value_g, uint8_t value_b); |
lixianyu | 0:5ca227682ee7 | 67 | |
lixianyu | 0:5ca227682ee7 | 68 | void setFastMode(); |
lixianyu | 0:5ca227682ee7 | 69 | void clearFastMode(); |
lixianyu | 0:5ca227682ee7 | 70 | |
lixianyu | 0:5ca227682ee7 | 71 | void setRow(uint8_t row, uint8_t value); |
lixianyu | 0:5ca227682ee7 | 72 | void setColumn(uint8_t col, uint8_t value); |
lixianyu | 0:5ca227682ee7 | 73 | |
lixianyu | 0:5ca227682ee7 | 74 | void setCursor(int16_t x, int16_t y); |
lixianyu | 0:5ca227682ee7 | 75 | virtual size_t write(uint8_t); |
lixianyu | 0:5ca227682ee7 | 76 | void displayChar(int8_t row, int8_t col, char _charIndex); |
lixianyu | 0:5ca227682ee7 | 77 | void writeString(int time, char * displayString); |
lixianyu | 0:5ca227682ee7 | 78 | |
lixianyu | 0:5ca227682ee7 | 79 | void (*Fun)(); |
lixianyu | 0:5ca227682ee7 | 80 | |
lixianyu | 0:5ca227682ee7 | 81 | protected: |
lixianyu | 0:5ca227682ee7 | 82 | uint8_t Devices_addr; |
lixianyu | 0:5ca227682ee7 | 83 | bool Fast_mode; |
lixianyu | 0:5ca227682ee7 | 84 | bool Font_mode; |
lixianyu | 0:5ca227682ee7 | 85 | uint8_t value_color[3]; |
lixianyu | 0:5ca227682ee7 | 86 | int16_t cursor_x, cursor_y; |
lixianyu | 0:5ca227682ee7 | 87 | int16_t _width, _height; // Display w/h as modified by current rotation |
lixianyu | 0:5ca227682ee7 | 88 | |
lixianyu | 0:5ca227682ee7 | 89 | uint8_t status[64]; |
lixianyu | 0:5ca227682ee7 | 90 | private : |
lixianyu | 0:5ca227682ee7 | 91 | uint8_t matrixIndex; // index into the channel data for this key |
lixianyu | 0:5ca227682ee7 | 92 | }; |
lixianyu | 0:5ca227682ee7 | 93 | |
lixianyu | 1:14b7c3a3ec60 | 94 | extern uint8_t pgm_read_byte(const uint8_t *p); |
lixianyu | 0:5ca227682ee7 | 95 | #endif |