Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

...I am trying to create a set of big number font for non-rtc clock..cant figure it out yet #1

Closed
SurenBono opened this issue Aug 18, 2019 · 9 comments

Comments

@SurenBono
Copy link

..closest similar project was http://code.google.com/p/arduino-timerone/ ..but the font is too thin..i was thinking like..see pic
16x2-Character-LCD-5x8-Pixel-Matrix-Grid

@SurenBono
Copy link
Author

Found a usefull link..that convert pixels to binary or hex ...with slight modifications on the sketch it..worked

https://maxpromer.github.io/LCD-Character-Creator/

replace to these init..

#include <LiquidCrystal.h>
#include <LCDKeypad.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

@SurenBono
Copy link
Author

SurenBono commented Aug 19, 2019

for char test purpose i wanted to just display the number 0 to 8 =16colx02row...each char consist of 4 segment 2col x2row .....but it can only display a byte of data ... meaning: 2 ( 2 row x 2 col) l = 8 byte..maximum 2 large letters..if i added more than 0-7..like 8th it would replace the 1st custom char segmented set to the new 3rd custom 4 segment / a set of letters....if programmed as
byte zero_a[8] = {B00000,B00000,B00011,B00110,B01110,B01110,B01110,B01110}; // 1st segment of the number Zero
...lcd.write(uint16_t(0)); // did not give me 2x returned err compiling

@SurenBono
Copy link
Author

lcd-8-byte-segment-big-font

@SurenBono
Copy link
Author

top is the only big custom font passed to init...below is the test for 3rd custom char..
3rd-char
..the 3rd char = 2 ,replaces the define 1st 4 byte = 0

@SurenBono
Copy link
Author

// Collected from Online resource
// https://maxpromer.github.io/LCD-Character-Creator/
// https://www.arduino.cc/en/Reference/LiquidCrystalCreateChar
// BIG FONT on 1602 Lcd display research/Test sketch by https://srotogargees.business.site/
// Init test done on 1602 LCD keypad module (parallel) stacked On Italian Chinese hybrid SMD atmega UNO.
// Change settings for test on 12c module as you please ..etc

#include <LiquidCrystal.h> // supplied drivers on IDE Library
#include <LCDKeypad.h> // downloaded drivers in User Document Library
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Parallel 4-bit Lcd pins with multiple resistored button on single A0 Constructors

byte zero_a[8] = {B00000,B00000,B00011,B00110,B01110,B01110,B01110,B01110}; // binary code
byte zero_b[8] = {B00000,B00000,B11100,B00110,B00111,B00111,B00111,B00111};
byte zero_c[8] = {B01110,B01110,B01110,B01110,B00110,B00011,B00000,B00000};
byte zero_d[8] = {B00111,B00111,B00111,B00111,B00110,B11100,B00000,B00000};

byte one_a[8] = {0x00,0x00,0x01,0x07,0x07,0x01,0x01,0x01}; // hex alternate
byte one_b[8] = {0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18};
byte one_c[8] = {B00001,B00001,B00001,B00001,B00001,B00001,B00000,B00000}; // binary and hex combo test
byte one_d[8] = {0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00};

byte two_a[8] = {0x00,0x00,0x07,0x0C,0x0C,0x00,0x00,0x00};
byte two_b[8] = {0x00,0x00,0x1E,0x07,0x07,0x07,0x0E,0x1C};
byte two_c[8] = {0x01,0x03,0x07,0x0E,0x0E,0x0F,0x00,0x00};
byte two_d[8] = {0x18,0x10,0x00,0x00,0x00,0x1F,0x00,0x00};

byte three_a[8] = {0x00,0x00,0x07,0x0E,0x00,0x00,0x00,0x01};
byte three_b[8] = {0x00,0x00,0x1E,0x07,0x07,0x07,0x07,0x1E};
byte three_c[8] = {0x00,0x00,0x00,0x0E,0x0E,0x07,0x00,0x00};
byte three_d[8] = {0x07,0x07,0x07,0x07,0x07,0x1E,0x00,0x00};

byte four_a[8] = {0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03};
byte four_b[8] = {0x00,0x00,0x0F,0x1F,0x1F,0x17,0x07,0x07};
byte four_c[8] = {0x06,0x0C,0x0C,0x0F,0x00,0x00,0x00,0x00};
byte four_d[8] = {0x07,0x07,0x07,0x1F,0x07,0x07,0x00,0x00};

void setup() {

lcd.begin(16, 2);

lcd.createChar(0, zero_a);
lcd.createChar(1, zero_b);
lcd.createChar(2, zero_c);
lcd.createChar(3, zero_d);

lcd.createChar(4, one_a);
lcd.createChar(5, one_b);
lcd.createChar(6, one_c);
lcd.createChar(7, one_d);

lcd.createChar(8, two_a); // i learned the LCD limitation here
lcd.createChar(9, two_b);
lcd.createChar(10,two_c);
lcd.createChar(11,two_d);

//lcd.createChar(12,three_a);
//lcd.createChar(13,three_b);
//lcd.createChar(14,three_c);
//lcd.createChar(15,three_d);

//lcd.createChar(16,three_a);
//lcd.createChar(17,three_b);
//lcd.createChar(18,three_c);
//lcd.createChar(19,three_d);

}

void loop() {

lcd.setCursor (0,0);
lcd.write(byte(0));
delay(100);
lcd.setCursor (1,0);
lcd.write(byte(1));
delay(100);
lcd.setCursor (0,1);
lcd.write(byte(2));
delay(100);
lcd.setCursor (1,1);
lcd.write(byte(3));
delay(100);

lcd.setCursor (2,0);
lcd.write(byte(4));
delay(100);
lcd.setCursor (3,0);
lcd.write(byte(5));
delay(100);
lcd.setCursor (2,1);
lcd.write(byte(6));
delay(100);
lcd.setCursor (3,1);
lcd.write(byte(7));

lcd.setCursor (4,0);
lcd.write(byte(8));
delay(100);
lcd.setCursor (5,0);
lcd.write(byte(9));
delay(100);
lcd.setCursor (4,1);
lcd.write(byte(10));
delay(100);
lcd.setCursor (5,1);
lcd.write(byte(11));

//lcd.setCursor (6,0);
//lcd.write(byte(12));
//delay(100);
//lcd.setCursor (7,0);
//lcd.write(byte(13));
//delay(100);
//lcd.setCursor (6,1);
//lcd.write(byte(14));
//delay(100);
//lcd.setCursor (7,1);
//lcd.write(byte(15));

//lcd.setCursor (6,0);
//lcd.write(byte(16));
//delay(100);
//lcd.setCursor (7,0);
//lcd.write(byte(17));
//delay(100);
//lcd.setCursor (6,1);
//lcd.write(byte(18));
//delay(100);
//lcd.setCursor (7,1);
//lcd.write(byte(19));

delay(2000);
lcd.clear();
delay(1000);
}

@SurenBono
Copy link
Author

big-font-limited

@SurenBono
Copy link
Author

bigdigits2NOTES
OLDSCHOOL1602LCD-KEYPAD-SYN
Resize-Wizard-1

#include <LiquidCrystal.h>
#include <LCDKeypad.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

uint8_t custChar[8][8] = {
{0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, //TOP_LEFT = BYTE 0
{0x07,0x07,0x00,0x00,0x00,0x00,0x07,0x07}, //LEFT_MID = BYTE 1
{0x1F,0x1F,0x00,0x00,0x00,0x00,0x1F,0x1F}, //TOP & MID = BYTE 2
{0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07}, //STRAIGHT_LEFT = BYTE 3
{0x00,0x0E,0x0A,0x0A,0x0A,0x0A,0x0E,0x00}, //DIVIDER = BYTE 4
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07}, //BOTTOM_LEFT = BYTE 5
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F}, //BOTTOM = BYTE 6
{0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00}, //TOP = BYTE 7
};
uint8_t bigNums[12][6] = {
{3, 7, 255, 3, 6, 255}, //0 , 254=BLANK / 255=FULL
{0, 255, 254, 5, 255, 6}, //1
{1, 2, 255, 3, 6, 6}, //2
{0, 2, 255, 5, 6, 255}, //3
{3, 6, 255, 254, 254, 255}, //4
{3, 2, 2, 5, 6, 255}, //5
{3, 2, 2, 3, 6, 255}, //6
{0, 7, 255, 254, 254, 255}, //7
{3, 2, 255, 3, 6, 255}, //8
{3, 2, 255, 254, 254, 255}, //9
{4}, //10 = DIVIDER 1C1R
{254, 254,254,254,254,254}, //11 = EMPTY

};

void printBigNum(int number, int startCol, int startRow) {

lcd.setCursor(startCol, startRow);
uint8_t thisNumber[6];
for (int cnt = 0; cnt < 6; cnt++) {
thisNumber[cnt] = bigNums[number][cnt];
}

// First line (top half) of digit
for (int cnt = 0; cnt < 3; cnt++) {
lcd.print((char)thisNumber[cnt]);
}

lcd.setCursor(startCol,startRow + 1); // cursor to next ROW at same column
for (int cnt = 3; cnt < 6; cnt++) {
lcd.print((char)thisNumber[cnt]);
}
}

void printDIVIDER(int number, int startCol, int startRow) {

lcd.setCursor(startCol, startRow);
uint8_t thisNumber[6];
for (int cnt = 0; cnt < 1; cnt++) {
thisNumber[cnt] = bigNums[number][cnt];
}

// First line (top half) of digit
for (int cnt = 0; cnt < 1; cnt++) {
lcd.print((char)thisNumber[cnt]);
}

lcd.setCursor(startCol,startRow + 1); // cursor to next ROW at same column
for (int cnt = 0; cnt < 1; cnt++) {
lcd.print((char)thisNumber[cnt]);
}
}

void setup() {
lcd.begin(16, 2);
for (int cnt = 0; cnt < sizeof(custChar) / 8; cnt++) {
lcd.createChar(cnt, custChar[cnt]);
}

}

void loop() {
lcd.clear();
delay(150);
printBigNum(1, 0, 0);
delay(150);
printBigNum(2,3,0);
delay(150);
printDIVIDER(10,6,0);
delay(150);
printBigNum(2,7,0);
delay(150);
printBigNum(3,10,0);
delay(150);
//printBigNum(4,13,0);
//delay(150);

lcd.setCursor (14,0);
lcd.write("AM");
lcd.setCursor (14,1);
lcd.write("27");
delay(1000);
lcd.setCursor (14,1);
lcd.write("28");
delay(1000);
lcd.setCursor (14,1);
lcd.write("29");
lcd.setCursor (14,1);
delay(1000);
lcd.write("28");

delay(1000);
delay(3000);
lcd.clear();

delay(150);
printBigNum(11,0,0);
delay(150);
printBigNum(6,3,0);
delay(150);

printDIVIDER(10,6,0);
delay(150);

printBigNum(5,7,0);
delay(150);
printBigNum(8,10,0);
delay(150);
//printBigNum(9,13,0);
lcd.setCursor (14,0);
lcd.write("PM");
lcd.setCursor (14,1);
lcd.write("59");
delay(150);
lcd.setCursor (14,1);
lcd.write("00");
delay(1000);
lcd.setCursor (14,1);
lcd.write("01");
delay(1000);
lcd.setCursor (14,1);
lcd.write("02");
lcd.setCursor (14,1);
delay(1000);
lcd.write("03");

delay(3000);
lcd.clear();
}

@SurenBono
Copy link
Author

SurenBono commented Sep 15, 2019

...Finally I figured it out...Thank you...check my repo for a newer version3.1 of NON - RTC/NTP/GPS 1602 LCD KEYPAD " ol school sync "12-H AM/PM timekeeping , +1 min /day accuracy + 3 COL x 2 ROW BIG DIGIT

@phuzybuny
Copy link

@SurenBono FYI I was able to create the original font by swapping the custom characters rapidly; however, there is noticeable flickering.

IMG_9036 - Copy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants