Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LED_DZ by
Microduino_MatrixBase.h
00001 // 本作品采用知识共享 署名-非商业性使用-相同方式共享 3.0 未本地化版本 许可协议进行许可 00002 // 访问 http://creativecommons.org/licenses/by-nc-sa/3.0/ 查看该许可协议 00003 // ============== 00004 00005 // 版权所有: 00006 // @老潘orz wasdpkj@hotmail.com 00007 // ============== 00008 00009 // Microduino-IDE 00010 // ============== 00011 // Microduino Getting start: 00012 // http://www.microduino.cc/download/ 00013 00014 // Microduino IDE Support: 00015 // https://github.com/wasdpkj/Microduino-IDE-Support/ 00016 00017 // ============== 00018 // Microduino wiki: 00019 // http://wiki.microduino.cc 00020 00021 // ============== 00022 // E-mail: 00023 // Kejia Pan 00024 // pankejia@microduino.cc 00025 00026 // ============== 00027 // Weibo: 00028 // @老潘orz 00029 00030 #ifndef Microduino_Matrix_base_h 00031 #define Microduino_Matrix_base_h 00032 #if 0 00033 #if (ARDUINO >= 100) 00034 #include "Arduino.h" 00035 #include "Print.h" 00036 #else 00037 #include "WProgram.h" 00038 #endif 00039 #endif 00040 #include "Fonts.h" 00041 //#include <Wire.h> 00042 //#include <avr/pgmspace.h> 00043 #include "mbed.h" 00044 #include "Printit.h" 00045 00046 #define MatrixPix_X 8 00047 #define MatrixPix_Y 8 00048 00049 class LedControl : public Print 00050 { 00051 public: 00052 LedControl(); 00053 // LedControl(uint8_t _addr); 00054 uint8_t getDeviceAddr(); 00055 void setDeviceAddr(uint8_t _addr); 00056 00057 void clearDisplay(); 00058 00059 void setColor(uint8_t value_r, uint8_t value_g, uint8_t value_b); 00060 void clearColor(); 00061 00062 void setFontMode(bool _Mode); 00063 00064 void setLed(uint8_t row, uint8_t column, bool state); 00065 void setLedColor(uint8_t row, uint8_t column, uint8_t value_r, uint8_t value_g, uint8_t value_b); 00066 void setLedColorFast(uint8_t row, uint8_t column, uint8_t value_r, uint8_t value_g, uint8_t value_b); 00067 00068 void setFastMode(); 00069 void clearFastMode(); 00070 00071 void setRow(uint8_t row, uint8_t value); 00072 void setColumn(uint8_t col, uint8_t value); 00073 00074 void setCursor(int16_t x, int16_t y); 00075 virtual size_t write(uint8_t); 00076 void displayChar(int8_t row, int8_t col, char _charIndex); 00077 void writeString(int time, char * displayString); 00078 00079 void (*Fun)(); 00080 00081 protected: 00082 uint8_t Devices_addr; 00083 bool Fast_mode; 00084 bool Font_mode; 00085 uint8_t value_color[3]; 00086 int16_t cursor_x, cursor_y; 00087 int16_t _width, _height; // Display w/h as modified by current rotation 00088 00089 uint8_t status[64]; 00090 private : 00091 uint8_t matrixIndex; // index into the channel data for this key 00092 }; 00093 00094 extern uint8_t pgm_read_byte(const uint8_t *p); 00095 #endif
Generated on Tue Jul 12 2022 21:09:39 by
1.7.2
