merged, ready for PR2

This commit is contained in:
Michael 2021-12-18 15:14:47 +01:00
parent d606cc9383
commit 7b7913e8f3
9 changed files with 2226 additions and 332 deletions

View File

@ -49,7 +49,7 @@ LedControl::LedControl(int dataPin, int clkPin, int csPin, int numDevices) {
SPI_CS=csPin;
if(numDevices<=0 || numDevices>8 )
numDevices=8;
maxDevices = numDevices;
maxDevices=numDevices;
pinMode(SPI_MOSI,OUTPUT);
pinMode(SPI_CLK,OUTPUT);
pinMode(SPI_CS,OUTPUT);
@ -59,14 +59,14 @@ LedControl::LedControl(int dataPin, int clkPin, int csPin, int numDevices) {
status[i]=0x00;
for(int i=0;i<maxDevices;i++) {
spiTransfer(i,OP_DISPLAYTEST,0);
//scanlimit is set to max on startup
//scanlimit is set to max on startup
setScanLimit(i,7);
//decode is done in source
//decode is done in source
spiTransfer(i,OP_DECODEMODE,0);
clearDisplay(i);
//we go into shutdown-mode on startup
//we go into shutdown-mode on startup
shutdown(i,true);
}
}
}
int LedControl::getDeviceCount() {
@ -208,4 +208,3 @@ void LedControl::spiTransfer(int addr, volatile byte opcode, volatile byte data)
digitalWrite(SPI_CS,HIGH);
}

View File

@ -187,4 +187,3 @@ class LedControl {
#endif //LedControl.h

View File

@ -25,9 +25,15 @@
*/
#include "LedMatrix.h"
//#include "font_5x8_horizontal_MSB.h"
#include "font_6x8_horizontal_MSB.h"
//#include "font_8x8_horizontal_latin_MSB.h"
#include "font_6x8_base.h"
//#include "font_6x8_UTF8_C2.h" // additional characters if needed
//#include "font_6x8_UTF8_C3.h" // additional characters (latin1) if needed
#include "../../../../tasmota/my_user_config.h" // to check compiler option USE_UTF8_LATIN1
#ifdef USE_UTF8_LATIN1
#include "font_6x8_UTF8_C2.h" // 256 bytes
#include "font_6x8_UTF8_C3.h" // 512 bytes
#endif
//the opcodes for the MAX7221 and MAX7219
#define OP_NOOP 0
@ -45,10 +51,6 @@
#define OP_SHUTDOWN 12
#define OP_DISPLAYTEST 15
// test
#include "LedControl.h"
LedControl* ledControl = nullptr;
// end text
LedMatrix::LedMatrix(int dataPin, int clkPin, int csPin, unsigned int colums, unsigned int rows)
{
if (colums * rows > MAX72XX_MAX_DEVICES)
@ -79,6 +81,7 @@ LedMatrix::LedMatrix(int dataPin, int clkPin, int csPin, unsigned int colums, un
textPosY = 0;
appendTextBuf[0] = 0;
setScrollAppendText(" ");
powerIsOn = false;
// initialize all connected MAX7219/MAX7221 devices
SPI_MOSI = dataPin;
@ -104,8 +107,9 @@ bool LedMatrix::drawText( const char *str, bool clearBefore)
strncpy(textBuf, str, TEXT_BUFFER_SIZE -1);
textPosX = 0;
textPosY = 0;
textWidth = strlen(textBuf) * charWidth;
if(textWidth < displayWidth)
textLen = countChars(str);
textWidth = textLen * charWidth;
if(textWidth <= displayWidth)
{
// text fits into the display, place it into the center
textPosX = (displayWidth - textWidth) / 2; // center
@ -113,8 +117,8 @@ bool LedMatrix::drawText( const char *str, bool clearBefore)
else
{
// The text ist longer than the display width. Scrolling is needed.
// Append a space between end of text and the beginning of the repeting text.
appendSpace();
// Add a space in front of text to have a distance to the pervious scroll text.
addSpace();
}
drawTextAt(textBuf, textPosX, textPosY);
refresh(); // refresh display with the new drawed string content
@ -124,19 +128,90 @@ bool LedMatrix::drawText( const char *str, bool clearBefore)
bool LedMatrix::drawTextAt( const char *str, const int x, const int y )
{
// draw character by character
unsigned int len = strlen(str);
int xPos = x;
for (unsigned int i = 0; i < len; i++)
const char* fontChar = nullptr;
for (unsigned int i = 0; (i<TEXT_BUFFER_SIZE && str[i]!=0); i++)
{
drawCharAt(str[i], xPos, y);
char c = str[i];
fontChar = font_20_7F[char('_') - 0x20]; // default character in case of non printable or undefined
if( c >= 0x20 && c < 0x80) // basic font
{
fontChar = font_20_7F[c-0x20];
}
#ifdef font_6x8_UTF8_C2_h
else if(c == 0xC2) // UTF special characters
{
i++;
c= str[i];
if(c>= 0xA0 && c < 0xC0)
{
fontChar = font_UTF_C2_A0_BF[c - 0xA0];
}
}
#endif // font_6x8_UTF8_C2_h
#ifdef font_6x8_UTF8_C3_h
else if(c == 0xC3) // UTF latin1
{
i++;
c= str[i];
if(c>= 0x80 && c < 0xC0)
{
fontChar = font_UTF_C3_80_BF[c - 0x80];
}
}
#endif // font_6x8_UTF8_C3_h
else if(c>= 0xC0 && c <= 0xDF)
{
i += 1; // 2 byte UTF sequence
}
else if(c>= 0xE0 && c <= 0xEF)
{
i += 2; // 3 byte UTF sequence
}
else if(c>= 0xF0 && c <= 0xF7)
{
i += 3; // 4 byte UTF sequence
}
drawCharAt(fontChar, xPos, y);
xPos += charWidth;
}
return true;
}
int LedMatrix::countChars( const char* utfText)
{
int len = 0;
for( int i = 0; (i<TEXT_BUFFER_SIZE && utfText[i]!=0); i++)
{
char c = utfText[i];
if( c < 0xC0)
{
// 1 byte UTF sequence
}
else if(c <= 0xDF)
{
i += 1; // 2 byte UTF sequence
}
else if(c <= 0xEF)
{
i += 2; // 3 byte UTF sequence
}
else if(c <= 0xF7)
{
i += 3; // 4 byte UTF sequence
}
len++;
}
return len;
}
bool LedMatrix::scrollText()
{
if(textWidth < displayWidth) return false; // do not scroll when text fits into the display
if(textWidth <= displayWidth) return false; // do not scroll when text fits into the display
textPosX--;
if(textPosX + textWidth < (int)0)
@ -157,11 +232,18 @@ bool LedMatrix::scrollText()
void LedMatrix::power(bool on)
{
powerIsOn = on;
byte value = 0; // 0: shutdown
if(on) value = 1; // 1: power on
spiTransfer_value(OP_SHUTDOWN, value); // power(false) shuts down the display
}
bool LedMatrix::isPowerOn()
{
return powerIsOn;
}
bool LedMatrix::clearDisplay(void)
{
memset(textBuf, 0, TEXT_BUFFER_SIZE);
@ -236,23 +318,34 @@ void LedMatrix::refresh()
if(moduleOrientation == ORIENTATION_NORMAL)
{
// ORIENTATION_NORMAL
deviceDataBuff[addr] = buffer[bufPos];
deviceRow = ledRow;
deviceDataBuff[addr] = revereBitorder(buffer[bufPos]); // mirror
deviceRow = 7 - ledRow; // upside down
}
else
{
// ORIENTATION_UPSIDE_DOWN
deviceDataBuff[addr] = revereBitorder(buffer[bufPos]); // mirror
deviceRow = 7 - ledRow; // upside down
deviceDataBuff[maxDevices -1 - addr] = buffer[bufPos];
deviceRow = ledRow;
}
}
else // ORIENTATION_TURN_RIGHT || ORIENTATION_TURN_LEFT
{
// not implemented yet
}
}
setRow_allDevices(deviceRow, deviceDataBuff);
}
}
// private functions
bool LedMatrix::drawCharAt( char c, const int x, const int y)
/**
* @brief
*
* @param fontChar defines the pixelrows of a character. const char fontChar[charHeight]
* @param x
* @param y
*/
bool LedMatrix::drawCharAt( const char* fontChar, const int x, const int y)
{
// ignore when the character position is not visible on the display
bool visible = (
@ -266,7 +359,7 @@ bool LedMatrix::drawCharAt( char c, const int x, const int y)
for (byte charY = 0; charY < charHeight; charY++)
{
char pixelRow = (font[c][charY]) << charOffset; // skip the first bits when the character width is smaller than 8 pixel
char pixelRow = (fontChar[charY]) << charOffset; // skip the first bits when the character width is smaller than 8 pixel
for (byte charX = 0; charX < charWidth; charX++)
{
bool pixel = (pixelRow & 0x80); // pixel=true when upper bit is set
@ -286,10 +379,12 @@ byte LedMatrix::revereBitorder (byte b)
return (lookup[b & 0b1111] << 4) | lookup[b >> 4];
}
void LedMatrix::appendSpace()
void LedMatrix::addSpace()
{
strncat(textBuf, appendTextBuf, TEXT_BUFFER_SIZE -1);
textWidth = strlen(textBuf) * charWidth;
textPosX = strlen(appendTextBuf) * charWidth; // start scrolling with space
textLen = countChars(textBuf);
textWidth = countChars(textBuf) * charWidth;
}
void LedMatrix::setRow_allDevices(int row, byte *data)

View File

@ -106,6 +106,8 @@ class LedMatrix
void power( bool on );
bool isPowerOn();
/**
* @brief cleares the display and text buffer
*
@ -136,7 +138,7 @@ class LedMatrix
*/
/**
* @brief Set the a pending string to the scrolling text to set a distance to the repeating text. Usually some spaces are used.
* @brief Adds a string before the scrolling text to set a distance. Usually some spaces are used.
*
* @param append text to append to the scrolling text before repeating.
*/
@ -151,9 +153,10 @@ class LedMatrix
private:
bool drawCharAt( char c, int x, int y ); // Draws a character to a defined position
bool drawCharAt( const char* fontChar, int x, int y ); // Draws a character to a defined position
int countChars( const char* utfText); // count the characters of an UTF8 string. To be uesd instead of strlen().
byte revereBitorder(byte b); // returnes the byte in the reverse bit order.
void appendSpace(); // appends characters to the end of the text to get a distance to the repeating scroll text
void addSpace(); // adds characters in front of the text to get a distance to the repeating scroll text
// device contrl MAX7219/MAX7221
/**
@ -196,10 +199,12 @@ class LedMatrix
int charHeight;
char textBuf[TEXT_BUFFER_SIZE];
char appendTextBuf[TEXT_APPEND_BUFFER_SIZE];
int textLen; // number of UTF8 characters
int textWidth; // width of text [pixel]
int textPosX; // horizontal pixel position of scrolling text
int textPosY; // vertical pixelposition of scrolling text;
byte spidata[SPI_BUFFER_SIZE]; // The array for shifting the data to the devices
bool powerIsOn;
};

View File

@ -0,0 +1,340 @@
// 6x8 ascii font
#ifndef font_6x8_UTF8_C2_h
#define font_6x8_UTF8_C2_h
/**
* additional characters to font_6x8_base.h
* 256 bytes
*
*/
/*
UTF8 after 0xC2
0 1 2 3 4 5 6 7 8 9 A B C D E F
A NBSP¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ SHY ® ¯
B ° ± ² ³ ´ µ · ¸ ¹ º » ¼ ½ ¾ ¿
*/
const char font_UTF_C2_A0_BF[0xC0-0xA0][8] = {
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x80 NBSP
{
0b00000100,
0b00000000,
0b00000100,
0b00000100,
0b00001110,
0b00001110,
0b00000100,
0b00000000,
}, // 0x81 ¡
{
0b00000000,
0b00000100,
0b00001110,
0b00010000,
0b00010000,
0b00001110,
0b00000100,
0b00000000,
}, // 0x82 ¢
{
0b00000110,
0b00001001,
0b00001000,
0b00011110,
0b00001000,
0b00001001,
0b00010111,
0b00000000,
}, // 0x83 £
{
0b00010001,
0b00001110,
0b00010001,
0b00010001,
0b00010001,
0b00001110,
0b00010001,
0b00000000,
}, // 0x84 ¤
{
0b00010001,
0b00001010,
0b00000100,
0b00011111,
0b00000100,
0b00011111,
0b00000100,
0b00000000,
}, // 0x85 ¥
{
0b00000100,
0b00000100,
0b00000100,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000000,
}, // 0x86 ¦
{
0b00001110,
0b00010001,
0b00001100,
0b00001010,
0b00000110,
0b00010001,
0b00001110,
0b00000000,
}, // 0x87 §
{
0b00000000,
0b00000000,
0b00000000,
0b00001010,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x88 ¨
{
0b00011110,
0b00100001,
0b00101101,
0b00101001,
0b00101101,
0b00100001,
0b00011110,
0b00000000,
}, // 0x89 ©
{
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
0b00001111,
0b00000000,
}, // 0x8A ª
{
0b00000000,
0b00000000,
0b00001001,
0b00010010,
0b00001001,
0b00000000,
0b00000000,
0b00000000,
}, // 0x8B «
{
0b00000000,
0b00000000,
0b00111111,
0b00000001,
0b00000001,
0b00000000,
0b00000000,
0b00000000,
}, // 0x8C ¬
{
0b00000000,
0b00000000,
0b00000000,
0b00000001,
0b00000001,
0b00000000,
0b11111111,
0b00000000,
}, // 0x8D SHY
{
0b00011110,
0b00100101,
0b00101011,
0b00101101,
0b00101011,
0b00100001,
0b00011110,
0b00000000,
}, // 0x8E ®
{
0b00000000,
0b00001110,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x8F ¯
{
0b00001100,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x90 °
{
0b00000000,
0b00000100,
0b00001110,
0b00000100,
0b00000000,
0b00001110,
0b00000000,
0b00000000,
}, // 0x91 ±
{
0b00011000,
0b00000100,
0b00001000,
0b00011100,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x92 ²
{
0b00011100,
0b00001000,
0b00001100,
0b00011000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x93 ³
{
0b00001100,
0b00001100,
0b00001000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x94 ´
{
0b00000000,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00011100,
0b00010000,
0b00010000,
}, // 0x95 µ
{
0b00001111,
0b00010101,
0b00010101,
0b00001101,
0b00000101,
0b00000101,
0b00000101,
0b00000000,
}, // 0x96 ¶
{
0b00000000,
0b00000000,
0b00000000,
0b00001000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x97 ·
{
0b00000000,
0b00000000,
0b00000000,
0b00001110,
0b00000110,
0b00000000,
0b00000000,
0b00000000,
}, // 0x98 ¸
{
0b00001000,
0b00011000,
0b00001000,
0b00001000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x99 ¹
{
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
0b00011110,
0b00000000,
}, // 0x9A º
{
0b00000000,
0b00000000,
0b00010010,
0b00001001,
0b00010010,
0b00000000,
0b00000000,
0b00000000,
}, // 0x9B »
{
0b00010000,
0b00010010,
0b00010100,
0b00001011,
0b00010101,
0b00000111,
0b00000001,
0b00000000,
}, // 0x9C ¼
{
0b00010000,
0b00010010,
0b00010100,
0b00001110,
0b00010001,
0b00000010,
0b00000111,
0b00000000,
}, // 0x9D ½
{
0b00110000,
0b00011010,
0b00110100,
0b00001011,
0b00010101,
0b00000111,
0b00000001,
0b00000000,
}, // 0x9E ¾
{
0b00000100,
0b00000000,
0b00000100,
0b00001100,
0b00010000,
0b00010001,
0b00001110,
0b00000000,
}, // 0x9F ¿
};
#endif // font_6x8_UTF8_C2_h

View File

@ -0,0 +1,678 @@
// 6x8 ascii font
#ifndef font_6x8_UTF8_C3_h
#define font_6x8_UTF8_C3_h
/**
* additional characters to font_6x8_base.h
* 512 bytes
*
*/
/*
UTF8 after 0xC3
0 1 2 3 4 5 6 7 8 9 A B C D E F
8 À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
9 Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
A à á â ã ä å æ ç è é ê ë ì í î ï
B ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
*/
const char font_UTF_C3_80_BF[0xC0-0x80][8] = {
{
0b00001100,
0b00000000,
0b00000100,
0b00001010,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x80 À
{
0b00000110,
0b00000000,
0b00000100,
0b00001010,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x81 Á
{
0b00001110,
0b00000000,
0b00000100,
0b00001010,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x82 Â
{
0b00000101,
0b00001010,
0b00000100,
0b00001010,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x83 Ã
{
0b00001010,
0b00000000,
0b00000100,
0b00001010,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x84 Ä
{
0b00001110,
0b00001010,
0b00001110,
0b00011011,
0b00010001,
0b00011111,
0b00010001,
0b00000000,
}, // 0x85 Å
{
0b00000111,
0b00001100,
0b00010100,
0b00010111,
0b00011100,
0b00010100,
0b00010111,
0b00000000,
}, // 0x86 Æ
{
0b00001110,
0b00010001,
0b00010000,
0b00010000,
0b00010001,
0b00001110,
0b00000100,
0b00001100,
}, // 0x87 Ç
{
0b00001100,
0b00000000,
0b00011111,
0b00010000,
0b00011110,
0b00010000,
0b00011111,
0b00000000,
}, // 0x88 È
{
0b00000011,
0b00000000,
0b00011111,
0b00010000,
0b00011110,
0b00010000,
0b00011111,
0b00000000,
}, // 0x89 É
{
0b00001110,
0b00000000,
0b00011111,
0b00010000,
0b00011110,
0b00010000,
0b00011111,
0b00000000,
}, // 0x8A Ê
{
0b00001010,
0b00000000,
0b00011111,
0b00010000,
0b00011110,
0b00010000,
0b00011111,
0b00000000,
}, // 0x8B Ë
{
0b00001100,
0b00000000,
0b00001110,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x8C Ì
{
0b00000110,
0b00000000,
0b00001110,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x8D Í
{
0b00001110,
0b00000000,
0b00001110,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x8E Î
{
0b00001010,
0b00000000,
0b00001110,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x8F Ï
{
0b00001110,
0b00001001,
0b00001001,
0b00011101,
0b00001001,
0b00001001,
0b00001110,
0b00000000,
}, // 0x90 Ð
{
0b00001010,
0b00010100,
0b00000000,
0b00010010,
0b00011010,
0b00010110,
0b00010010,
0b00000000,
}, // 0x91 Ñ
{
0b00011000,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x92 Ò
{
0b00000110,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x93 Ó
{
0b00001110,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x94 Ô
{
0b00001010,
0b00010100,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x95 Õ
{
0b00010010,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x96 Ö
{
0b00000000,
0b00010001,
0b00001010,
0b00000100,
0b00001010,
0b00010001,
0b00000000,
0b00000000,
}, // 0x97 ×
{
0b00001111,
0b00010011,
0b00010101,
0b00010101,
0b00010101,
0b00011001,
0b00011110,
0b00000000,
}, // 0x98 Ø
{
0b00011000,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x99 Ù
{
0b00000110,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x9A Ú
{
0b00001110,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x9B Û
{
0b00001010,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0x9C Ü
{
0b00000110,
0b00000000,
0b00010001,
0b00001010,
0b00000100,
0b00000100,
0b00000100,
0b00000000,
}, // 0x9D Ý
{
0b00011000,
0b00010000,
0b00011100,
0b00010010,
0b00010010,
0b00011100,
0b00010000,
0b00011000,
}, // 0x9E Þ
{
0b00000000,
0b00011100,
0b00010010,
0b00011100,
0b00010010,
0b00010010,
0b00011100,
0b00010000,
}, // 0x9F ß
{
0b00001100,
0b00000000,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA0 à
{
0b00000110,
0b00000000,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA1 á
{
0b00001110,
0b00000000,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA2 â
{
0b00000101,
0b00001010,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA3 ã
{
0b00001010,
0b00000000,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA4 ä
{
0b00001110,
0b00001010,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0xA5 å
{
0b00000000,
0b00000000,
0b00011110,
0b00000101,
0b00011111,
0b00010100,
0b00001111,
0b00000000,
}, // 0xA6 æ
{
0b00000000,
0b00001110,
0b00010001,
0b00010000,
0b00010001,
0b00001110,
0b00000100,
0b00001100,
}, // 0xA7 ç
{
0b00001100,
0b00000000,
0b00001110,
0b00010001,
0b00011110,
0b00010000,
0b00001110,
0b00000000,
}, // 0xA8 è
{
0b00000011,
0b00000000,
0b00001110,
0b00010001,
0b00011110,
0b00010000,
0b00001110,
0b00000000,
}, // 0xA9 é
{
0b00001110,
0b00000000,
0b00001110,
0b00010001,
0b00011110,
0b00010000,
0b00001110,
0b00000000,
}, // 0xAA ê
{
0b00001010,
0b00000000,
0b00001110,
0b00010001,
0b00011110,
0b00010000,
0b00001110,
0b00000000,
}, // 0xAB ë
{
0b00001000,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0xAC ì
{
0b00000110,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0xAD í
{
0b00000110,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0xAE î
{
0b00001010,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0xAF ï
{
0b00001100,
0b00010000,
0b00001000,
0b00000100,
0b00001110,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB0 ð
{
0b00001010,
0b00010100,
0b00000000,
0b00011100,
0b00010010,
0b00010010,
0b00010010,
0b00000000,
}, // 0xB1 ñ
{
0b00011000,
0b00000000,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB2 ò
{
0b00000110,
0b00000000,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB3 ó
{
0b00001110,
0b00000000,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB4 ô
{
0b00001010,
0b00010100,
0b00000000,
0b00001100,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB5 õ
{
0b00001010,
0b00000000,
0b00001100,
0b00010010,
0b00010010,
0b00010010,
0b00001100,
0b00000000,
}, // 0xB6 ö
{
0b00000000,
0b00000100,
0b00000000,
0b00011111,
0b00000000,
0b00000100,
0b00000000,
0b00000000,
}, // 0xB7 ÷
{
0b00000000,
0b00000000,
0b00000001,
0b00001110,
0b00010110,
0b00011010,
0b00011100,
0b00100000,
}, // 0xB8 ø
{
0b00011000,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010110,
0b00001010,
0b00000000,
}, // 0xB9 ù
{
0b00000110,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010110,
0b00001010,
0b00000000,
}, // 0xBA ú
{
0b00001110,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010110,
0b00001010,
0b00000000,
}, // 0xBB û
{
0b00010010,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010110,
0b00001010,
0b00000000,
}, // 0xBC ü
{
0b00000110,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00001110,
0b00000100,
0b00011000,
}, // 0xBD ý
{
0b00000000,
0b00011000,
0b00010000,
0b00011100,
0b00010010,
0b00011100,
0b00010000,
0b00011000,
}, // 0xBE þ
{
0b00001010,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00001110,
0b00000100,
0b00011000,
}, // 0xBF ÿ
};
/*
ISO/IEC 8859-1 (latin1)
0 1 2 3 4 5 6 7 8 9 A B C D E F
A NBSP ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ SHY ® ¯
B ° ± ² ³ ´ µ · ¸ ¹ º » ¼ ½ ¾ ¿
C À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
D Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
E à á â ã ä å æ ç è é ê ë ì í î ï
F ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
*/
#endif // font_6x8_UTF8_C3_h

View File

@ -0,0 +1,986 @@
// 6x8 ascii font
#ifndef font_6x8_base_h
#define font_6x8_base_h
/**
* Momory size of basic ascii font: 768 bytes
*
*/
/*
0 1 2 3 4 5 6 7 8 9 A B C D E F
2 SP ! " # $ % & ' ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ \ ] ^ _
6 ` a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { | } ~
*/
const unsigned int font_char_width = 6;
const unsigned int font_char_height = 8;
const char font_20_7F[0x80-0x20][8] = {
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x20
{
0b00000100,
0b00001110,
0b00001110,
0b00000100,
0b00000100,
0b00000000,
0b00000100,
0b00000000,
}, // 0x21 !
{
0b00011011,
0b00011011,
0b00010010,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x22 "
{
0b00000000,
0b00001010,
0b00011111,
0b00001010,
0b00001010,
0b00011111,
0b00001010,
0b00000000,
}, // 0x23 #
{
0b00001000,
0b00001110,
0b00010000,
0b00001100,
0b00000010,
0b00011100,
0b00000100,
0b00000000,
}, // 0x24 $
{
0b00011001,
0b00011001,
0b00000010,
0b00000100,
0b00001000,
0b00010011,
0b00010011,
0b00000000,
}, // 0x25 %
{
0b00001000,
0b00010100,
0b00010100,
0b00001000,
0b00010101,
0b00010010,
0b00001101,
0b00000000,
}, // 0x26 &
{
0b00001100,
0b00001100,
0b00001000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x27 '
{
0b00000100,
0b00001000,
0b00001000,
0b00001000,
0b00001000,
0b00001000,
0b00000100,
0b00000000,
}, // 0x28 (
{
0b00001000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00001000,
0b00000000,
}, // 0x29 )
{
0b00000000,
0b00001010,
0b00001110,
0b00011111,
0b00001110,
0b00001010,
0b00000000,
0b00000000,
}, // 0x2A *
{
0b00000000,
0b00000100,
0b00000100,
0b00011111,
0b00000100,
0b00000100,
0b00000000,
0b00000000,
}, // 0x2B +
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00001000,
}, // 0x2C ,
{
0b00000000,
0b00000000,
0b00000000,
0b00011111,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x2D -
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
}, // 0x2E .
{
0b00000000,
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00000000,
0b00000000,
}, // 0x2F /
{
0b00001110,
0b00010001,
0b00010011,
0b00010101,
0b00011001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x30 0
{
0b00000100,
0b00001100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x31 1
{
0b00001110,
0b00010001,
0b00000001,
0b00000110,
0b00001000,
0b00010000,
0b00011111,
0b00000000,
}, // 0x32 2
{
0b00001110,
0b00010001,
0b00000001,
0b00001110,
0b00000001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x33 3
{
0b00000010,
0b00000110,
0b00001010,
0b00010010,
0b00011111,
0b00000010,
0b00000010,
0b00000000,
}, // 0x34 4
{
0b00011111,
0b00010000,
0b00010000,
0b00011110,
0b00000001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x35 5
{
0b00000110,
0b00001000,
0b00010000,
0b00011110,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x36 6
{
0b00011111,
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00001000,
0b00001000,
0b00000000,
}, // 0x37 7
{
0b00001110,
0b00010001,
0b00010001,
0b00001110,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x38 8
{
0b00001110,
0b00010001,
0b00010001,
0b00001111,
0b00000001,
0b00000010,
0b00001100,
0b00000000,
}, // 0x39 9
{
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
}, // 0x3A :
{
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
0b00001100,
0b00001100,
0b00001000,
}, // 0x3B ;
{
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00001000,
0b00000100,
0b00000010,
0b00000000,
}, // 0x3C <
{
0b00000000,
0b00000000,
0b00011111,
0b00000000,
0b00000000,
0b00011111,
0b00000000,
0b00000000,
}, // 0x3D =
{
0b00001000,
0b00000100,
0b00000010,
0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00000000,
}, // 0x3E >
{
0b00001110,
0b00010001,
0b00000001,
0b00000110,
0b00000100,
0b00000000,
0b00000100,
0b00000000,
}, // 0x3F ?
{
0b00001110,
0b00010001,
0b00010111,
0b00010101,
0b00010111,
0b00010000,
0b00001110,
0b00000000,
}, // 0x40 @
{
0b00001110,
0b00010001,
0b00010001,
0b00010001,
0b00011111,
0b00010001,
0b00010001,
0b00000000,
}, // 0x41 A
{
0b00011110,
0b00010001,
0b00010001,
0b00011110,
0b00010001,
0b00010001,
0b00011110,
0b00000000,
}, // 0x42 B
{
0b00001110,
0b00010001,
0b00010000,
0b00010000,
0b00010000,
0b00010001,
0b00001110,
0b00000000,
}, // 0x43 C
{
0b00011110,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00011110,
0b00000000,
}, // 0x44 D
{
0b00011111,
0b00010000,
0b00010000,
0b00011110,
0b00010000,
0b00010000,
0b00011111,
0b00000000,
}, // 0x45 E
{
0b00011111,
0b00010000,
0b00010000,
0b00011110,
0b00010000,
0b00010000,
0b00010000,
0b00000000,
}, // 0x46 F
{
0b00001110,
0b00010001,
0b00010000,
0b00010111,
0b00010001,
0b00010001,
0b00001111,
0b00000000,
}, // 0x47 G
{
0b00010001,
0b00010001,
0b00010001,
0b00011111,
0b00010001,
0b00010001,
0b00010001,
0b00000000,
}, // 0x48 H
{
0b00001110,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00001110,
0b00000000,
}, // 0x49 I
{
0b00000001,
0b00000001,
0b00000001,
0b00000001,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x4A J
{
0b00010001,
0b00010010,
0b00010100,
0b00011000,
0b00010100,
0b00010010,
0b00010001,
0b00000000,
}, // 0x4B K
{
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00011111,
0b00000000,
}, // 0x4C L
{
0b00010001,
0b00011011,
0b00010101,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00000000,
}, // 0x4D M
{
0b00010001,
0b00011001,
0b00010101,
0b00010011,
0b00010001,
0b00010001,
0b00010001,
0b00000000,
}, // 0x4E N
{
0b00001110,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x4F O
{
0b00011110,
0b00010001,
0b00010001,
0b00011110,
0b00010000,
0b00010000,
0b00010000,
0b00000000,
}, // 0x50 P
{
0b00001110,
0b00010001,
0b00010001,
0b00010001,
0b00010101,
0b00010010,
0b00001101,
0b00000000,
}, // 0x51 Q
{
0b00011110,
0b00010001,
0b00010001,
0b00011110,
0b00010010,
0b00010001,
0b00010001,
0b00000000,
}, // 0x52 R
{
0b00001110,
0b00010001,
0b00010000,
0b00001110,
0b00000001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x53 S
{
0b00011111,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000000,
}, // 0x54 T
{
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x55 U
{
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00010001,
0b00001010,
0b00000100,
0b00000000,
}, // 0x56 V
{
0b00010001,
0b00010001,
0b00010101,
0b00010101,
0b00010101,
0b00010101,
0b00001010,
0b00000000,
}, // 0x57 W
{
0b00010001,
0b00010001,
0b00001010,
0b00000100,
0b00001010,
0b00010001,
0b00010001,
0b00000000,
}, // 0x58 X
{
0b00010001,
0b00010001,
0b00010001,
0b00001010,
0b00000100,
0b00000100,
0b00000100,
0b00000000,
}, // 0x59 Y
{
0b00011110,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00010000,
0b00011110,
0b00000000,
}, // 0x5A Z
{
0b00001110,
0b00001000,
0b00001000,
0b00001000,
0b00001000,
0b00001000,
0b00001110,
0b00000000,
}, // 0x5B [
{
0b00000000,
0b00010000,
0b00001000,
0b00000100,
0b00000010,
0b00000001,
0b00000000,
0b00000000,
}, // 0x5C backslash
{
0b00001110,
0b00000010,
0b00000010,
0b00000010,
0b00000010,
0b00000010,
0b00001110,
0b00000000,
}, // 0x5D ]
{
0b00000100,
0b00001010,
0b00010001,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x5E ^
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00111111,
}, // 0x5F _
{
0b00001100,
0b00001100,
0b00000100,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x60 `
{
0b00000000,
0b00000000,
0b00001110,
0b00000001,
0b00001111,
0b00010001,
0b00001111,
0b00000000,
}, // 0x61 a
{
0b00010000,
0b00010000,
0b00011110,
0b00010001,
0b00010001,
0b00010001,
0b00011110,
0b00000000,
}, // 0x62 b
{
0b00000000,
0b00000000,
0b00001110,
0b00010001,
0b00010000,
0b00010001,
0b00001110,
0b00000000,
}, // 0x63 c
{
0b00000001,
0b00000001,
0b00001111,
0b00010001,
0b00010001,
0b00010001,
0b00001111,
0b00000000,
}, // 0x64 d
{
0b00000000,
0b00000000,
0b00001110,
0b00010001,
0b00011110,
0b00010000,
0b00001110,
0b00000000,
}, // 0x65 e
{
0b00000110,
0b00001000,
0b00001000,
0b00011110,
0b00001000,
0b00001000,
0b00001000,
0b00000000,
}, // 0x66 f
{
0b00000000,
0b00000000,
0b00001111,
0b00010001,
0b00010001,
0b00001111,
0b00000001,
0b00001110,
}, // 0x67 g
{
0b00010000,
0b00010000,
0b00011100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00000000,
}, // 0x68 h
{
0b00000100,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0x69 i
{
0b00000010,
0b00000000,
0b00000110,
0b00000010,
0b00000010,
0b00000010,
0b00010010,
0b00001100,
}, // 0x6A j
{
0b00010000,
0b00010000,
0b00010010,
0b00010100,
0b00011000,
0b00010100,
0b00010010,
0b00000000,
}, // 0x6B k
{
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000100,
0b00000110,
0b00000000,
}, // 0x6C l
{
0b00000000,
0b00000000,
0b00011010,
0b00010101,
0b00010101,
0b00010001,
0b00010001,
0b00000000,
}, // 0x6D m
{
0b00000000,
0b00000000,
0b00011100,
0b00010010,
0b00010010,
0b00010010,
0b00010010,
0b00000000,
}, // 0x6E n
{
0b00000000,
0b00000000,
0b00001110,
0b00010001,
0b00010001,
0b00010001,
0b00001110,
0b00000000,
}, // 0x6F o
{
0b00000000,
0b00000000,
0b00011110,
0b00010001,
0b00010001,
0b00010001,
0b00011110,
0b00010000,
}, // 0x70 p
{
0b00000000,
0b00000000,
0b00001111,
0b00010001,
0b00010001,
0b00010001,
0b00001111,
0b00000001,
}, // 0x71 q
{
0b00000000,
0b00000000,
0b00010110,
0b00001001,
0b00001000,
0b00001000,
0b00011100,
0b00000000,
}, // 0x72 r
{
0b00000000,
0b00000000,
0b00001110,
0b00010000,
0b00001110,
0b00000001,
0b00001110,
0b00000000,
}, // 0x73 s
{
0b00000000,
0b00001000,
0b00011110,
0b00001000,
0b00001000,
0b00001010,
0b00000100,
0b00000000,
}, // 0x74 t
{
0b00000000,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00010110,
0b00001010,
0b00000000,
}, // 0x75 u
{
0b00000000,
0b00000000,
0b00010001,
0b00010001,
0b00010001,
0b00001010,
0b00000100,
0b00000000,
}, // 0x76 v
{
0b00000000,
0b00000000,
0b00010001,
0b00010001,
0b00010101,
0b00011111,
0b00001010,
0b00000000,
}, // 0x77 w
{
0b00000000,
0b00000000,
0b00010010,
0b00010010,
0b00001100,
0b00010010,
0b00010010,
0b00000000,
}, // 0x78 x
{
0b00000000,
0b00000000,
0b00010010,
0b00010010,
0b00010010,
0b00001110,
0b00000100,
0b00011000,
}, // 0x79 y
{
0b00000000,
0b00000000,
0b00011110,
0b00000010,
0b00001100,
0b00010000,
0b00011110,
0b00000000,
}, // 0x7A z
{
0b00000110,
0b00001000,
0b00001000,
0b00011000,
0b00001000,
0b00001000,
0b00000110,
0b00000000,
}, // 0x7B {
{
0b00000100,
0b00000100,
0b00000100,
0b00000000,
0b00000100,
0b00000100,
0b00000100,
0b00000000,
}, // 0x7C |
{
0b00001100,
0b00000010,
0b00000010,
0b00000011,
0b00000010,
0b00000010,
0b00001100,
0b00000000,
}, // 0x7D }
{
0b00001010,
0b00010100,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
}, // 0x7E ~
{
0b00000100,
0b00001110,
0b00011011,
0b00010001,
0b00010001,
0b00011111,
0b00000000,
0b00000000,
}, // 0x7F ␡
};
#endif // font_6x8_base_h

View File

@ -1,267 +0,0 @@
// 6x8 ascii font
#ifndef font_6x8_horizontal_MSB_h
#define font_6x8_horizontal_MSB_h
const unsigned int font_char_width = 6;
const unsigned int font_char_height = 8;
const char font[256][8]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x00
{0x0E,0x11,0x1B,0x11,0x15,0x11,0x0E,0x00}, // 0x01
{0x0E,0x1F,0x15,0x1F,0x11,0x1F,0x0E,0x00}, // 0x02
{0x00,0x0A,0x1F,0x1F,0x1F,0x0E,0x04,0x00}, // 0x03
{0x00,0x04,0x0E,0x1F,0x1F,0x0E,0x04,0x00}, // 0x04
{0x04,0x0E,0x0E,0x04,0x1F,0x1F,0x04,0x00}, // 0x05
{0x00,0x04,0x0E,0x1F,0x1F,0x04,0x0E,0x00}, // 0x06
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x07
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x08
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x09
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x0A
{0x00,0x07,0x03,0x0D,0x12,0x12,0x0C,0x00}, // 0x0B
{0x0E,0x11,0x11,0x0E,0x04,0x0E,0x04,0x00}, // 0x0C
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x0D
{0x03,0x0D,0x0B,0x0D,0x0B,0x1B,0x18,0x00}, // 0x0E
{0x00,0x15,0x0E,0x1B,0x0E,0x15,0x00,0x00}, // 0x0F
{0x08,0x0C,0x0E,0x0F,0x0E,0x0C,0x08,0x00}, // 0x10
{0x02,0x06,0x0E,0x1E,0x0E,0x06,0x02,0x00}, // 0x11
{0x04,0x0E,0x1F,0x04,0x1F,0x0E,0x04,0x00}, // 0x12
{0x0A,0x0A,0x0A,0x0A,0x0A,0x00,0x0A,0x00}, // 0x13
{0x0F,0x15,0x15,0x0D,0x05,0x05,0x05,0x00}, // 0x14
{0x0E,0x11,0x0C,0x0A,0x06,0x11,0x0E,0x00}, // 0x15
{0x00,0x00,0x00,0x00,0x00,0x1E,0x1E,0x00}, // 0x16
{0x04,0x0E,0x1F,0x04,0x1F,0x0E,0x04,0x0E}, // 0x17
{0x04,0x0E,0x1F,0x04,0x04,0x04,0x04,0x00}, // 0x18
{0x04,0x04,0x04,0x04,0x1F,0x0E,0x04,0x00}, // 0x19
{0x00,0x04,0x06,0x1F,0x06,0x04,0x00,0x00}, // 0x1A
{0x00,0x04,0x0C,0x1F,0x0C,0x04,0x00,0x00}, // 0x1B
{0x00,0x00,0x00,0x10,0x10,0x10,0x1F,0x00}, // 0x1C
{0x00,0x0A,0x0A,0x1F,0x0A,0x0A,0x00,0x00}, // 0x1D
{0x04,0x04,0x0E,0x0E,0x1F,0x1F,0x00,0x00}, // 0x1E
{0x1F,0x1F,0x0E,0x0E,0x04,0x04,0x00,0x00}, // 0x1F
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x20
{0x04,0x0E,0x0E,0x04,0x04,0x00,0x04,0x00}, // 0x21
{0x1B,0x1B,0x12,0x00,0x00,0x00,0x00,0x00}, // 0x22
{0x00,0x0A,0x1F,0x0A,0x0A,0x1F,0x0A,0x00}, // 0x23
{0x08,0x0E,0x10,0x0C,0x02,0x1C,0x04,0x00}, // 0x24
{0x19,0x19,0x02,0x04,0x08,0x13,0x13,0x00}, // 0x25
{0x08,0x14,0x14,0x08,0x15,0x12,0x0D,0x00}, // 0x26
{0x0C,0x0C,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x27
{0x04,0x08,0x08,0x08,0x08,0x08,0x04,0x00}, // 0x28
{0x08,0x04,0x04,0x04,0x04,0x04,0x08,0x00}, // 0x29
{0x00,0x0A,0x0E,0x1F,0x0E,0x0A,0x00,0x00}, // 0x2A
{0x00,0x04,0x04,0x1F,0x04,0x04,0x00,0x00}, // 0x2B
{0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x08}, // 0x2C
{0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00}, // 0x2D
{0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x00}, // 0x2E
{0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00}, // 0x2F
{0x0E,0x11,0x13,0x15,0x19,0x11,0x0E,0x00}, // 0x30
{0x04,0x0C,0x04,0x04,0x04,0x04,0x0E,0x00}, // 0x31
{0x0E,0x11,0x01,0x06,0x08,0x10,0x1F,0x00}, // 0x32
{0x0E,0x11,0x01,0x0E,0x01,0x11,0x0E,0x00}, // 0x33
{0x02,0x06,0x0A,0x12,0x1F,0x02,0x02,0x00}, // 0x34
{0x1F,0x10,0x10,0x1E,0x01,0x11,0x0E,0x00}, // 0x35
{0x06,0x08,0x10,0x1E,0x11,0x11,0x0E,0x00}, // 0x36
{0x1F,0x01,0x02,0x04,0x08,0x08,0x08,0x00}, // 0x37
{0x0E,0x11,0x11,0x0E,0x11,0x11,0x0E,0x00}, // 0x38
{0x0E,0x11,0x11,0x0F,0x01,0x02,0x0C,0x00}, // 0x39
{0x00,0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x00}, // 0x3A
{0x00,0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x08}, // 0x3B
{0x02,0x04,0x08,0x10,0x08,0x04,0x02,0x00}, // 0x3C
{0x00,0x00,0x1F,0x00,0x00,0x1F,0x00,0x00}, // 0x3D
{0x08,0x04,0x02,0x01,0x02,0x04,0x08,0x00}, // 0x3E
{0x0E,0x11,0x01,0x06,0x04,0x00,0x04,0x00}, // 0x3F
{0x0E,0x11,0x17,0x15,0x17,0x10,0x0E,0x00}, // 0x40
{0x0E,0x11,0x11,0x11,0x1F,0x11,0x11,0x00}, // 0x41
{0x1E,0x11,0x11,0x1E,0x11,0x11,0x1E,0x00}, // 0x42
{0x0E,0x11,0x10,0x10,0x10,0x11,0x0E,0x00}, // 0x43
{0x1E,0x11,0x11,0x11,0x11,0x11,0x1E,0x00}, // 0x44
{0x1F,0x10,0x10,0x1E,0x10,0x10,0x1F,0x00}, // 0x45
{0x1F,0x10,0x10,0x1E,0x10,0x10,0x10,0x00}, // 0x46
{0x0E,0x11,0x10,0x17,0x11,0x11,0x0F,0x00}, // 0x47
{0x11,0x11,0x11,0x1F,0x11,0x11,0x11,0x00}, // 0x48
{0x0E,0x04,0x04,0x04,0x04,0x04,0x0E,0x00}, // 0x49
{0x01,0x01,0x01,0x01,0x11,0x11,0x0E,0x00}, // 0x4A
{0x11,0x12,0x14,0x18,0x14,0x12,0x11,0x00}, // 0x4B
{0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0x00}, // 0x4C
{0x11,0x1B,0x15,0x11,0x11,0x11,0x11,0x00}, // 0x4D
{0x11,0x19,0x15,0x13,0x11,0x11,0x11,0x00}, // 0x4E
{0x0E,0x11,0x11,0x11,0x11,0x11,0x0E,0x00}, // 0x4F
{0x1E,0x11,0x11,0x1E,0x10,0x10,0x10,0x00}, // 0x50
{0x0E,0x11,0x11,0x11,0x15,0x12,0x0D,0x00}, // 0x51
{0x1E,0x11,0x11,0x1E,0x12,0x11,0x11,0x00}, // 0x52
{0x0E,0x11,0x10,0x0E,0x01,0x11,0x0E,0x00}, // 0x53
{0x1F,0x04,0x04,0x04,0x04,0x04,0x04,0x00}, // 0x54
{0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00}, // 0x55
{0x11,0x11,0x11,0x11,0x11,0x0A,0x04,0x00}, // 0x56
{0x11,0x11,0x15,0x15,0x15,0x15,0x0A,0x00}, // 0x57
{0x11,0x11,0x0A,0x04,0x0A,0x11,0x11,0x00}, // 0x58
{0x11,0x11,0x11,0x0A,0x04,0x04,0x04,0x00}, // 0x59
{0x1E,0x02,0x04,0x08,0x10,0x10,0x1E,0x00}, // 0x5A
{0x0E,0x08,0x08,0x08,0x08,0x08,0x0E,0x00}, // 0x5B
{0x00,0x10,0x08,0x04,0x02,0x01,0x00,0x00}, // 0x5C
{0x0E,0x02,0x02,0x02,0x02,0x02,0x0E,0x00}, // 0x5D
{0x04,0x0A,0x11,0x00,0x00,0x00,0x00,0x00}, // 0x5E
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F}, // 0x5F
{0x0C,0x0C,0x04,0x00,0x00,0x00,0x00,0x00}, // 0x60
{0x00,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0x61
{0x10,0x10,0x1E,0x11,0x11,0x11,0x1E,0x00}, // 0x62
{0x00,0x00,0x0E,0x11,0x10,0x11,0x0E,0x00}, // 0x63
{0x01,0x01,0x0F,0x11,0x11,0x11,0x0F,0x00}, // 0x64
{0x00,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00}, // 0x65
{0x06,0x08,0x08,0x1E,0x08,0x08,0x08,0x00}, // 0x66
{0x00,0x00,0x0F,0x11,0x11,0x0F,0x01,0x0E}, // 0x67
{0x10,0x10,0x1C,0x12,0x12,0x12,0x12,0x00}, // 0x68
{0x04,0x00,0x04,0x04,0x04,0x04,0x06,0x00}, // 0x69
{0x02,0x00,0x06,0x02,0x02,0x02,0x12,0x0C}, // 0x6A
{0x10,0x10,0x12,0x14,0x18,0x14,0x12,0x00}, // 0x6B
{0x04,0x04,0x04,0x04,0x04,0x04,0x06,0x00}, // 0x6C
{0x00,0x00,0x1A,0x15,0x15,0x11,0x11,0x00}, // 0x6D
{0x00,0x00,0x1C,0x12,0x12,0x12,0x12,0x00}, // 0x6E
{0x00,0x00,0x0E,0x11,0x11,0x11,0x0E,0x00}, // 0x6F
{0x00,0x00,0x1E,0x11,0x11,0x11,0x1E,0x10}, // 0x70
{0x00,0x00,0x0F,0x11,0x11,0x11,0x0F,0x01}, // 0x71
{0x00,0x00,0x16,0x09,0x08,0x08,0x1C,0x00}, // 0x72
{0x00,0x00,0x0E,0x10,0x0E,0x01,0x0E,0x00}, // 0x73
{0x00,0x08,0x1E,0x08,0x08,0x0A,0x04,0x00}, // 0x74
{0x00,0x00,0x12,0x12,0x12,0x16,0x0A,0x00}, // 0x75
{0x00,0x00,0x11,0x11,0x11,0x0A,0x04,0x00}, // 0x76
{0x00,0x00,0x11,0x11,0x15,0x1F,0x0A,0x00}, // 0x77
{0x00,0x00,0x12,0x12,0x0C,0x12,0x12,0x00}, // 0x78
{0x00,0x00,0x12,0x12,0x12,0x0E,0x04,0x18}, // 0x79
{0x00,0x00,0x1E,0x02,0x0C,0x10,0x1E,0x00}, // 0x7A
{0x06,0x08,0x08,0x18,0x08,0x08,0x06,0x00}, // 0x7B
{0x04,0x04,0x04,0x00,0x04,0x04,0x04,0x00}, // 0x7C
{0x0C,0x02,0x02,0x03,0x02,0x02,0x0C,0x00}, // 0x7D
{0x0A,0x14,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x7E
{0x04,0x0E,0x1B,0x11,0x11,0x1F,0x00,0x00}, // 0x7F
{0x0E,0x11,0x10,0x10,0x11,0x0E,0x04,0x0C}, // 0x80
{0x12,0x00,0x12,0x12,0x12,0x16,0x0A,0x00}, // 0x81
{0x03,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00}, // 0x82
{0x0E,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0x83
{0x0A,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0x84
{0x0C,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0x85
{0x0E,0x0A,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0x86
{0x00,0x0E,0x11,0x10,0x11,0x0E,0x04,0x0C}, // 0x87
{0x0E,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00}, // 0x88
{0x0A,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00}, // 0x89
{0x0C,0x00,0x0E,0x11,0x1E,0x10,0x0E,0x00}, // 0x8A
{0x0A,0x00,0x04,0x04,0x04,0x04,0x06,0x00}, // 0x8B
{0x0E,0x00,0x04,0x04,0x04,0x04,0x06,0x00}, // 0x8C
{0x08,0x00,0x04,0x04,0x04,0x04,0x06,0x00}, // 0x8D
{0x0A,0x00,0x04,0x0A,0x11,0x1F,0x11,0x00}, // 0x8E
{0x0E,0x0A,0x0E,0x1B,0x11,0x1F,0x11,0x00}, // 0x8F
{0x03,0x00,0x1F,0x10,0x1E,0x10,0x1F,0x00}, // 0x90
{0x00,0x00,0x1E,0x05,0x1F,0x14,0x0F,0x00}, // 0x91
{0x0F,0x14,0x14,0x1F,0x14,0x14,0x17,0x00}, // 0x92
{0x0E,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00}, // 0x93
{0x0A,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00}, // 0x94
{0x18,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00}, // 0x95
{0x0E,0x00,0x12,0x12,0x12,0x16,0x0A,0x00}, // 0x96
{0x18,0x00,0x12,0x12,0x12,0x16,0x0A,0x00}, // 0x97
{0x0A,0x00,0x12,0x12,0x12,0x0E,0x04,0x18}, // 0x98
{0x12,0x0C,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0x99
{0x0A,0x00,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0x9A
{0x00,0x00,0x01,0x0E,0x16,0x1A,0x1C,0x20}, // 0x9B
{0x06,0x09,0x08,0x1E,0x08,0x09,0x17,0x00}, // 0x9C
{0x0F,0x13,0x15,0x15,0x15,0x19,0x1E,0x00}, // 0x9D
{0x00,0x11,0x0A,0x04,0x0A,0x11,0x00,0x00}, // 0x9E
{0x02,0x05,0x04,0x0E,0x04,0x04,0x14,0x08}, // 0x9F
{0x06,0x00,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0xA0
{0x06,0x00,0x04,0x04,0x04,0x04,0x06,0x00}, // 0xA1
{0x06,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00}, // 0xA2
{0x06,0x00,0x12,0x12,0x12,0x16,0x0A,0x00}, // 0xA3
{0x0A,0x14,0x00,0x1C,0x12,0x12,0x12,0x00}, // 0xA4
{0x0A,0x14,0x00,0x12,0x1A,0x16,0x12,0x00}, // 0xA5
{0x0E,0x01,0x0F,0x11,0x0F,0x00,0x0F,0x00}, // 0xA6
{0x0C,0x12,0x12,0x12,0x0C,0x00,0x1E,0x00}, // 0xA7
{0x04,0x00,0x04,0x0C,0x10,0x11,0x0E,0x00}, // 0xA8
{0x1E,0x25,0x2B,0x2D,0x2B,0x21,0x1E,0x00}, // 0xA9
{0x00,0x00,0x3F,0x01,0x01,0x00,0x00,0x00}, // 0xAA
{0x10,0x12,0x14,0x0E,0x11,0x02,0x07,0x00}, // 0xAB
{0x10,0x12,0x14,0x0B,0x15,0x07,0x01,0x00}, // 0xAC
{0x04,0x00,0x04,0x04,0x0E,0x0E,0x04,0x00}, // 0xAD
{0x00,0x00,0x09,0x12,0x09,0x00,0x00,0x00}, // 0xAE
{0x00,0x00,0x12,0x09,0x12,0x00,0x00,0x00}, // 0xAF
{0x15,0x00,0x2A,0x00,0x15,0x00,0x2A,0x00}, // 0xB0
{0x15,0x2A,0x15,0x2A,0x15,0x2A,0x15,0x2A}, // 0xB1
{0x2A,0x3F,0x15,0x3F,0x2A,0x3F,0x15,0x3F}, // 0xB2
{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}, // 0xB3
{0x04,0x04,0x04,0x3C,0x04,0x04,0x04,0x04}, // 0xB4
{0x06,0x00,0x04,0x0A,0x11,0x1F,0x11,0x00}, // 0xB5
{0x0E,0x00,0x04,0x0A,0x11,0x1F,0x11,0x00}, // 0xB6
{0x0C,0x00,0x04,0x0A,0x11,0x1F,0x11,0x00}, // 0xB7
{0x1E,0x21,0x2D,0x29,0x2D,0x21,0x1E,0x00}, // 0xB8
{0x14,0x34,0x04,0x34,0x14,0x14,0x14,0x14}, // 0xB9
{0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14}, // 0xBA
{0x00,0x3C,0x04,0x34,0x14,0x14,0x14,0x14}, // 0xBB
{0x14,0x34,0x04,0x3C,0x00,0x00,0x00,0x00}, // 0xBC
{0x00,0x04,0x0E,0x10,0x10,0x0E,0x04,0x00}, // 0xBD
{0x11,0x0A,0x04,0x1F,0x04,0x1F,0x04,0x00}, // 0xBE
{0x00,0x00,0x00,0x3C,0x04,0x04,0x04,0x04}, // 0xBF
{0x04,0x04,0x04,0x07,0x00,0x00,0x00,0x00}, // 0xC0
{0x04,0x04,0x04,0x3F,0x00,0x00,0x00,0x00}, // 0xC1
{0x00,0x00,0x00,0x3F,0x04,0x04,0x04,0x04}, // 0xC2
{0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x04}, // 0xC3
{0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00}, // 0xC4
{0x04,0x04,0x04,0x3F,0x04,0x04,0x04,0x04}, // 0xC5
{0x05,0x0A,0x0E,0x01,0x0F,0x11,0x0F,0x00}, // 0xC6
{0x05,0x0A,0x04,0x0A,0x11,0x1F,0x11,0x00}, // 0xC7
{0x14,0x17,0x10,0x1F,0x00,0x00,0x00,0x00}, // 0xC8
{0x00,0x1F,0x10,0x17,0x14,0x14,0x14,0x14}, // 0xC9
{0x14,0x37,0x00,0x3F,0x00,0x00,0x00,0x00}, // 0xCA
{0x00,0x3F,0x00,0x37,0x14,0x14,0x14,0x14}, // 0xCB
{0x14,0x17,0x10,0x17,0x14,0x14,0x14,0x14}, // 0xCC
{0x00,0x3F,0x00,0x3F,0x00,0x00,0x00,0x00}, // 0xCD
{0x14,0x37,0x00,0x37,0x14,0x14,0x14,0x14}, // 0xCE
{0x11,0x0E,0x11,0x11,0x11,0x0E,0x11,0x00}, // 0xCF
{0x0C,0x10,0x08,0x04,0x0E,0x12,0x0C,0x00}, // 0xD0
{0x0E,0x09,0x09,0x1D,0x09,0x09,0x0E,0x00}, // 0xD1
{0x0E,0x00,0x1F,0x10,0x1E,0x10,0x1F,0x00}, // 0xD2
{0x0A,0x00,0x1F,0x10,0x1E,0x10,0x1F,0x00}, // 0xD3
{0x0C,0x00,0x1F,0x10,0x1E,0x10,0x1F,0x00}, // 0xD4
{0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00}, // 0xD5
{0x06,0x00,0x0E,0x04,0x04,0x04,0x0E,0x00}, // 0xD6
{0x0E,0x00,0x0E,0x04,0x04,0x04,0x0E,0x00}, // 0xD7
{0x0A,0x00,0x0E,0x04,0x04,0x04,0x0E,0x00}, // 0xD8
{0x04,0x04,0x04,0x3C,0x00,0x00,0x00,0x00}, // 0xD9
{0x00,0x00,0x00,0x07,0x04,0x04,0x04,0x04}, // 0xDA
{0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F}, // 0xDB
{0x00,0x00,0x00,0x00,0x3F,0x3F,0x3F,0x3F}, // 0xDC
{0x04,0x04,0x04,0x00,0x04,0x04,0x04,0x00}, // 0xDD
{0x0C,0x00,0x0E,0x04,0x04,0x04,0x0E,0x00}, // 0xDE
{0x3F,0x3F,0x3F,0x3F,0x00,0x00,0x00,0x00}, // 0xDF
{0x06,0x0C,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xE0
{0x00,0x1C,0x12,0x1C,0x12,0x12,0x1C,0x10}, // 0xE1
{0x0E,0x0C,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xE2
{0x18,0x0C,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xE3
{0x0A,0x14,0x00,0x0C,0x12,0x12,0x0C,0x00}, // 0xE4
{0x0A,0x14,0x0C,0x12,0x12,0x12,0x0C,0x00}, // 0xE5
{0x00,0x00,0x12,0x12,0x12,0x1C,0x10,0x10}, // 0xE6
{0x00,0x18,0x10,0x1C,0x12,0x1C,0x10,0x18}, // 0xE7
{0x18,0x10,0x1C,0x12,0x12,0x1C,0x10,0x18}, // 0xE8
{0x06,0x00,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xE9
{0x0E,0x00,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xEA
{0x18,0x00,0x12,0x12,0x12,0x12,0x0C,0x00}, // 0xEB
{0x06,0x00,0x12,0x12,0x12,0x0E,0x04,0x18}, // 0xEC
{0x06,0x00,0x11,0x0A,0x04,0x04,0x04,0x00}, // 0xED
{0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xEE
{0x0C,0x0C,0x08,0x00,0x00,0x00,0x00,0x00}, // 0xEF
{0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00}, // 0xF0
{0x00,0x04,0x0E,0x04,0x00,0x0E,0x00,0x00}, // 0xF1
{0x00,0x00,0x1F,0x00,0x00,0x1F,0x00,0x00}, // 0xF2
{0x30,0x1A,0x34,0x0B,0x15,0x07,0x01,0x00}, // 0xF3
{0x0F,0x15,0x15,0x0D,0x05,0x05,0x05,0x00}, // 0xF4
{0x0E,0x11,0x0C,0x0A,0x06,0x11,0x0E,0x00}, // 0xF5
{0x00,0x04,0x00,0x1F,0x00,0x04,0x00,0x00}, // 0xF6
{0x00,0x00,0x00,0x0E,0x06,0x00,0x00,0x00}, // 0xF7
{0x0C,0x12,0x12,0x0C,0x00,0x00,0x00,0x00}, // 0xF8
{0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x00}, // 0xF9
{0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00}, // 0xFA
{0x08,0x18,0x08,0x08,0x00,0x00,0x00,0x00}, // 0xFB
{0x1C,0x08,0x0C,0x18,0x00,0x00,0x00,0x00}, // 0xFC
{0x18,0x04,0x08,0x1C,0x00,0x00,0x00,0x00}, // 0xFD
{0x00,0x00,0x1E,0x1E,0x1E,0x1E,0x00,0x00}, // 0xFE
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} // 0xFF
};
#endif

View File

@ -39,7 +39,7 @@
Once the GPIO configuration is saved and the ESP8266/ESP32 module restarts,
set the Display Model to 19 and Display Mode to 0
Depending on order oth the wired 8x8 matrix modules you have got a display of size pixel_width x pixel_height.
Depending on order of the wired 8x8 matrix modules you have got a display of size pixel_width x pixel_height.
The size has to be set with the commands "DisplayWidth <pixel_width>" and "DisplayHeight <pixel_height>"
After the ESP8266/ESP32 module restarts again, turn ON the display with the command "Power 1"
@ -55,6 +55,10 @@
DisplayDimmer [0..100]
Sets the intensity of the display.
DisplayBlinkrate [0..3]
0: not blinking
1: slow, 2: medium 3: fast blinking
Power [ON|OFF]
Sitches the display on or off. When "off", the display buffer is not cleared and will be shown again when after "Power ON".
Other display commands are still active when off.
@ -72,13 +76,18 @@
DisplayHeight [8..256]
Sets the pixel height of the display (8x number of module rows)
DisplayRotate [0|2]
0: normal orientation; devide 0 starts at top left
2: upside down; device 0 starts at bottom right
DisplayClock [0|1|2]
Displays a clock.
Commands "DisplayClock 1" // 12 hr format
"DisplayClock 2" // 24 hr format
"DisplayClock 0" // turn off clock
"DisplayClock 0" // turn off clock; please use additional cammand: DisplayMode 0
If you would like to use the UTF8 latin1 character set, it cam be added by copile option:
#define USE_UTF8_LATIN1
\*********************************************************************************************/
@ -86,10 +95,6 @@
#include <LedMatrix.h>
#ifdef USE_DISPLAY_MODES1TO5
#include <time.h>
#endif
LedMatrix *max7219_Matrix = nullptr;
bool max2791Matrix_initDriver_done = false;
struct
@ -99,7 +104,9 @@ struct
byte scroll_delay = 0;
byte scroll_iteration = 0;
bool show_clock = false;
const char *timeFormat;
bool timeFormat24 = true;
byte blink_delay = 0; // 0: not blinking
byte blink_iteration = 0;
} LedMatrix_settings;
@ -138,7 +145,8 @@ bool MAX7291Matrix_initDriver(void)
bool MAX7291Matrix_init(void)
{
Settings->display_mode = 0; // text mode
LedMatrix_settings.show_clock = 0; // no clock
LedMatrix_settings.show_clock = 0; // no
LedMatrix_settings.blink_delay = 0; // no blinking
int intensity = GetDisplayDimmer16(); // 0..15
max7219_Matrix->setIntensity(intensity);
@ -158,6 +166,13 @@ bool MAX7291Matrix_init(void)
return true;
}
bool MAX7291Matrix_setText(bool clearBefore=true)
{
if(Settings->display_mode != 0) MAX7291Matrix_init();
LedMatrix_settings.blink_delay = 0; // no blinking
return max7219_Matrix->drawText(XdrvMailbox.data, clearBefore);
}
// FUNC_DISPLAY_SCROLLDELAY
bool MAX7291Matrix_scrollDelay(void)
{
@ -178,6 +193,8 @@ bool MAX7291Matrix_scrollText(void)
// This function is called every 50 ms.
// scroll_delay defines the number of cycles to be ignored until the display scrolls by one pixel to the left.
// e.g. scrall_delay = 4 causes a scroll each 200 ms.
if(!max7219_Matrix->isPowerOn()) return false; // do not scroll on power off
LedMatrix_settings.scroll_iteration++;
if (LedMatrix_settings.scroll_delay)
LedMatrix_settings.scroll_iteration = LedMatrix_settings.scroll_iteration % LedMatrix_settings.scroll_delay;
@ -189,6 +206,41 @@ bool MAX7291Matrix_scrollText(void)
return max7219_Matrix->scrollText();
}
bool MAX7291Matrix_blink(void)
{
// This function is called every 50 ms.
// blink_delay defines the number of cycles to be ignored until the blinkstate changes.
if(LedMatrix_settings.blink_delay == 0) return false;
LedMatrix_settings.blink_iteration++;
if(LedMatrix_settings.blink_iteration == LedMatrix_settings.blink_delay)
{
max7219_Matrix->power(false);
}
else if(LedMatrix_settings.blink_iteration == 2* LedMatrix_settings.blink_delay )
{
LedMatrix_settings.blink_iteration = 0;
max7219_Matrix->power(true);
}
return true;
}
bool MAX7291Matrix_setBlinkRate()
{
LedMatrix_settings.blink_iteration = 0;
max7219_Matrix->power(true);
if (ArgC() == 0)
{
XdrvMailbox.payload = 0;
}
if (XdrvMailbox.payload)
LedMatrix_settings.blink_delay = 20 / XdrvMailbox.payload; // 1: once per second; 2: twice per second; 3: three times per second
else
LedMatrix_settings.blink_delay = 0; // do not blink
return true;
}
#ifdef USE_DISPLAY_MODES1TO5
// FUNC_DISPLAY_CLOCK
bool MAX7291Matrix_clock(void)
@ -204,29 +256,19 @@ bool MAX7291Matrix_clock(void)
return true;
case 1:
// 12 h clock
LedMatrix_settings.timeFormat = "%I:%M";
if(LedMatrix_settings.modulesPerRow > 6)
{
LedMatrix_settings.timeFormat = "%I:%M:%S";
}
LedMatrix_settings.timeFormat24 = false;
Settings->display_mode = 1;
break;
case 2:
// 24 h clock
LedMatrix_settings.timeFormat = "%H:%M";
if(LedMatrix_settings.modulesPerRow > 6)
{
LedMatrix_settings.timeFormat = "%H:%M:%S";
}
LedMatrix_settings.timeFormat24 = true;
Settings->display_mode = 1;
break;
default:
//LedMatrix_settings.timeFormat = XdrvMailbox.payload;
//Settings->display_mode = 1;
return false;
}
AddLog(LOG_LEVEL_DEBUG, PSTR("MTX: LedMatrix_settings.show_clock %d, timeFormat %s"), LedMatrix_settings.show_clock, LedMatrix_settings.timeFormat);
AddLog(LOG_LEVEL_DEBUG, PSTR("MTX: LedMatrix_settings.show_clock %d, 24h: %b"), LedMatrix_settings.show_clock, LedMatrix_settings.timeFormat24);
max7219_Matrix->clearDisplay();
MAX7291Matrix_showTime();
@ -236,17 +278,30 @@ bool MAX7291Matrix_clock(void)
// FUNC_DISPLAY_EVERY_SECOND
bool MAX7291Matrix_showTime()
{
time_t rawtime;
struct tm *timeinfo;
if(!LedMatrix_settings.show_clock) return false;
uint8_t hr = RtcTime.hour;
uint8_t mn = RtcTime.minute;
uint8_t sc = RtcTime.second;
char timeStr[10];
if(!LedMatrix_settings.timeFormat24)
{
if(hr == 0) hr = 12;
if(hr > 12 ) hr -= 12;
}
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(timeStr, 10, LedMatrix_settings.timeFormat, timeinfo);
if(LedMatrix_settings.modulesPerRow >= 6)
{
snprintf(timeStr, 10, "%02d:%02d:%02d", hr , mn, sc);
}
else
{
snprintf(timeStr, 10, "%02d:%02d", hr , mn);
}
max7219_Matrix->drawText(timeStr, false); // false: do not clear desplay on update to prevent flicker
return true;
}
#endif // USE_DISPLAY_MODES1TO5
@ -280,17 +335,21 @@ bool Xdsp19(uint8_t function)
case FUNC_DISPLAY_DRAW_STRING:
case FUNC_DISPLAY_SCROLLTEXT:
case FUNC_DISPLAY_SEVENSEG_TEXT:
if(Settings->display_mode != 0) MAX7291Matrix_init();
result = max7219_Matrix->drawText(XdrvMailbox.data, true); // true: clears display before drawing text
result = MAX7291Matrix_setText(true); // true: clears display before drawing text
break;
case FUNC_DISPLAY_SEVENSEG_TEXTNC:
if(Settings->display_mode != 0) MAX7291Matrix_init();
result = max7219_Matrix->drawText(XdrvMailbox.data, false); // false: does not clear display before drawing text
result = MAX7291Matrix_setText(false); // false: does not clear display before drawing text
break;
case FUNC_DISPLAY_SCROLLDELAY:
result = MAX7291Matrix_scrollDelay();
break;
case FUNC_DISPLAY_BLINKRATE:
{
result = MAX7291Matrix_setBlinkRate();
break;
}
case FUNC_DISPLAY_EVERY_50_MSECOND:
MAX7291Matrix_blink();
result = MAX7291Matrix_scrollText();
break;