Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
MeLEDMatrix.h
Go to the documentation of this file.
1 
49 #ifndef _ME_LED_MATRIX_H_
50 #define _ME_LED_MATRIX_H_
51 
52 #include "MePort.h"
53 #define PointOn 1
54 #define PointOff 0
55 
56 
57 #define LED_BUFFER_SIZE 16
58 #define STRING_DISPLAY_BUFFER_SIZE 20
59 
60 
61 //Define Data Command Parameters
62 #define Mode_Address_Auto_Add_1 0x40 //0100 0000 B
63 #define Mode_Permanent_Address 0x44 //0100 0100 B
64 
65 
66 //Define Address Command Parameters
67 #define ADDRESS(addr) (0xC0 | addr)
68 
69 
70 typedef enum
71 {
82 
83 
84 
85 /* Me LED Matrix 8X16 */
91 class MeLEDMatrix:public MePort
92 {
93 public:
100  MeLEDMatrix();
101 
108  MeLEDMatrix(uint8_t port);
109 
118  MeLEDMatrix(uint8_t SCK_Pin, uint8_t DIN_Pin);
119 
134  void clearScreen();
135 
150  void setBrightness(uint8_t Bright);
151 
166  void setColorIndex(bool Color_Number);
167 
188  void drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap);
189 
208  void drawStr(int16_t X_position, int8_t Y_position, const char *str);
209 
228  void showClock(uint8_t hour, uint8_t minute, bool = PointOn);
229 
246  void showNum(float value,uint8_t = 3);
247 
262  void reset(uint8_t port);
263 
264 private:
265  uint8_t u8_SCKPin;
266  uint8_t u8_DINPin;
267 
268  bool b_Color_Index;
269  bool b_Draw_Str_Flag;
270 
271  uint8_t u8_Display_Buffer[LED_BUFFER_SIZE];
272 
273  int16_t i16_Str_Display_X_Position;
274  int8_t i8_Str_Display_Y_Position;
275  int16_t i16_Number_of_Character_of_Str;
276  char i8_Str_Display_Buffer[STRING_DISPLAY_BUFFER_SIZE];
277 
292  void writeByte(uint8_t data);
293 
312  void writeBytesToAddress(uint8_t Address, const uint8_t *P_data, uint8_t count_of_data);
313 
326  void showStr();
327 
328 };
329 
330 #endif
Definition: MeLEDMatrix.h:73
Definition: MeLEDMatrix.h:77
Port Mapping for RJ25.
Definition: MePort.h:118
Definition: MeLEDMatrix.h:72
void showNum(float value, uint8_t=3)
Definition: MeLEDMatrix.cpp:650
#define STRING_DISPLAY_BUFFER_SIZE
Definition: MeLEDMatrix.h:58
void setColorIndex(bool Color_Number)
Definition: MeLEDMatrix.cpp:305
void showClock(uint8_t hour, uint8_t minute, bool=PointOn)
Definition: MeLEDMatrix.cpp:589
void clearScreen()
Definition: MeLEDMatrix.cpp:248
Driver for Me LED Matrix module.
Definition: MeLEDMatrix.h:91
Definition: MeLEDMatrix.h:76
LED_Matrix_Brightness_TypeDef
Definition: MeLEDMatrix.h:70
Definition: MeLEDMatrix.h:80
Definition: MeLEDMatrix.h:78
Definition: MeLEDMatrix.h:75
Definition: MeLEDMatrix.h:79
void drawStr(int16_t X_position, int8_t Y_position, const char *str)
Definition: MeLEDMatrix.cpp:377
void reset(uint8_t port)
Definition: MeLEDMatrix.cpp:120
Definition: MeLEDMatrix.h:74
void setBrightness(uint8_t Bright)
Definition: MeLEDMatrix.cpp:275
Header for MePort.cpp module.
#define LED_BUFFER_SIZE
Definition: MeLEDMatrix.h:57
MeLEDMatrix()
Definition: MeLEDMatrix.cpp:57
void drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap)
Definition: MeLEDMatrix.cpp:330
#define PointOn
Definition: MeLEDMatrix.h:53