MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
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{
72 Brightness_0 = 0,
73 Brightness_1,
74 Brightness_2,
75 Brightness_3,
76 Brightness_4,
77 Brightness_5,
78 Brightness_6,
79 Brightness_7,
80 Brightness_8
81}LED_Matrix_Brightness_TypeDef;
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
MePort.h
Header for MePort.cpp module.
MeLEDMatrix
Driver for Me LED Matrix module.
Definition MeLEDMatrix.h:92
MeLEDMatrix::drawStr
void drawStr(int16_t X_position, int8_t Y_position, const char *str)
Definition MeLEDMatrix.cpp:377
MeLEDMatrix::reset
void reset(uint8_t port)
Definition MeLEDMatrix.cpp:120
MeLEDMatrix::drawBitmap
void drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap)
Definition MeLEDMatrix.cpp:330
MeLEDMatrix::setColorIndex
void setColorIndex(bool Color_Number)
Definition MeLEDMatrix.cpp:305
MeLEDMatrix::MeLEDMatrix
MeLEDMatrix()
Definition MeLEDMatrix.cpp:57
MeLEDMatrix::showNum
void showNum(float value, uint8_t=3)
Definition MeLEDMatrix.cpp:650
MeLEDMatrix::showClock
void showClock(uint8_t hour, uint8_t minute, bool=PointOn)
Definition MeLEDMatrix.cpp:589
MeLEDMatrix::setBrightness
void setBrightness(uint8_t Bright)
Definition MeLEDMatrix.cpp:275
MeLEDMatrix::clearScreen
void clearScreen()
Definition MeLEDMatrix.cpp:248
MePort
Port Mapping for RJ25.
Definition MePort.h:128