Added font numbers3x5_blocky.

This commit is contained in:
Fabian Schlenz 2019-09-04 06:02:16 +02:00
parent 0d23e5ec6c
commit bf1666fb32
2 changed files with 18 additions and 5 deletions

View File

@ -2,4 +2,5 @@
#include "prototypes.h" #include "prototypes.h"
extern Font font_numbers3x5; extern Font font_numbers3x5;
extern Font font_numbers3x5_blocky;
extern Font font_numbers4x7; extern Font font_numbers4x7;

View File

@ -10,14 +10,26 @@ const uint8_t font_numbers3x5_data[] PROGMEM = {
B01110, B10101, B10110, // 6 B01110, B10101, B10110, // 6
B10000, B10011, B11100, // 7 B10000, B10011, B11100, // 7
B11111, B10101, B11111, // 8 B11111, B10101, B11111, // 8
B01101, B10101, B01110, // 9
};
bool font_numbers3x5_check(const char c) { return c>='0' && c<='9'; }
uint16_t font_numbers3x5_get(const char c) { return c - '0'; }
Font font_numbers3x5 = {3, 5, &font_numbers3x5_data[0], font_numbers3x5_check, font_numbers3x5_get};
const uint8_t font_numbers3x5_blocky_data[] PROGMEM = {
B11111, B10001, B11111, // 0
B00000, B11111, B00000, // 1
B10111, B10101, B11101, // 2
B10001, B10101, B11111, // 3
B11100, B00100, B11111, // 4
B11101, B10101, B11111, // 5
B11111, B10101, B10111, // 6
B10000, B10000, B11111, // 7
B11111, B10101, B11111, // 8
B11101, B10101, B11111, // 9 B11101, B10101, B11111, // 9
}; };
Font font_numbers3x5_blocky = {3, 5, &font_numbers3x5_blocky_data[0], font_numbers3x5_check, font_numbers3x5_get};
bool font_numbers3x5_check(const char c) { return c>='0' && c<='9'; }
uint16_t font_numbers3x5_get(const char c) { return c - '0'; }
Font font_numbers3x5 = {3, 5, &font_numbers3x5_data[0], font_numbers3x5_check, font_numbers3x5_get};
const uint8_t font_numbers4x7_data[] PROGMEM = { const uint8_t font_numbers4x7_data[] PROGMEM = {
0x3E, 0x51, 0x45, 0x3E,// 0 0x3E, 0x51, 0x45, 0x3E,// 0