author
8CommentsNew ZealandJoined April 19th, 2018
I like re-using/re-purposing/recycling old pieces of technology.
  • tony-arduino commented on mpilchfamily's instructable Custom Large Font for 16x2 LCDs5 months ago
    Custom Large Font for 16x2 LCDs

    Made a standalone version of my lowercase characters in case anyone wanted a simple way to try them out:/* * I have backported this from my custom driver library, into a standalone sketch so the structure is a bit odd * The library was designed so that output was done through normal lcd.print statements and that looked after * printing strings and numbers etc ... this version just does simple character at a time output. * But you can turn on "autoScroll" and just keep writing and scrolling forever if you want. */ // Include the library code:#include <LiquidCrystal.h>// Initialize the library with the numbers of the interface pins// rs, enable, d0, d1, d2, d3, d4, d5, d6, d7//// You have to change this to reflect your hardware connections (d0 to d3 optional)LiquidCrystal...

    see more »

    Made a standalone version of my lowercase characters in case anyone wanted a simple way to try them out:/* * I have backported this from my custom driver library, into a standalone sketch so the structure is a bit odd * The library was designed so that output was done through normal lcd.print statements and that looked after * printing strings and numbers etc ... this version just does simple character at a time output. * But you can turn on "autoScroll" and just keep writing and scrolling forever if you want. */ // Include the library code:#include <LiquidCrystal.h>// Initialize the library with the numbers of the interface pins// rs, enable, d0, d1, d2, d3, d4, d5, d6, d7//// You have to change this to reflect your hardware connections (d0 to d3 optional)LiquidCrystal lcd(12, 13, 4, 5, 6, 7, 8, 9, 10, 11);#define mx300_bigfont1c // Set to bigfont1b, bigfont1c as desired// bigfont1c - Based on Michael Pilcher/Dale Gass's original, but altered characters and lowercase & punctuation added// bigfont1b - Michael Pilcher/Dale Gass's character set with slight alterations and lowercase addeduint8_t rows = 2;uint8_t cols = 20;uint8_t currline;uint8_t currcol;bool autoScroll; // auto scroll-left if writing beyond column 19bool shifted; // we have reached column 20bool writebig; // write the next characters in bigfont//unsigned long count;//boolean scroll = false;//int pos = 0;// Michael's set of user programmable characters for rounded big fontsstatic uint8_t charpixels[8][8] = {{ 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F},{ 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00},{ 0x1C, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F},{ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07},{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F},{ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1E, 0x1C},{ 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F},{ 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F},};// Full 96 ASCII character set, 4 bytes for upper half, 4 bytes for lower half of each character// each byte defines which LCD character for use, usually one of the user-defined ones from the array above// but any character can be used// 32 = space// 45 = minus sign// 255 = solid block// 'e', 's' and 'z' are a bit ugly#ifdef mx300_bigfont1cstatic const uint8_t bigFont[96][8] = {{32,32,32,32,32,32,32,32}, // space{5,32,32,32,4,32,32,32}, // !{0,0,32,32,32,32,32,32}, // "{4,0,0,4,4,3,3,4}, // #{0,255,6,32,7,255,5,32}, // ${1,4,5,32,0,1,4,32}, // %{0,255,4,32,3,5,7,32}, // &{0,32,32,32,32,32,32,32}, // '{0,32,32,32,3,32,32,32}, // ({2,32,32,32,5,32,32,32}, // ){3,255,5,32,0,255,2,32}, // *{32,4,32,32,1,255,1,32}, // +{32,32,32,32,5,32,32,32}, // ,{32,32,32,32,1,1,1,32}, // -{32,32,32,32,4,32,32,32}, // .{32,4,5,32,0,1,32,32}, // /{0,1,2,32,3,4,5,32}, // 0{1,2,32,32,4,255,4,32}, // 1{6,6,2,32,3,7,7,32}, // 2{6,6,2,32,7,7,5,32}, // 3{3,4,2,32,32,32,5,32}, // 4{3,6,6,32,4,7,5,32}, // 5{0,6,6,32,3,7,5,32}, // 6{1,1,2,32,32,0,32,32}, // 7{0,6,2,32,3,7,5,32}, // 8{0,6,2,32,32,32,5,32}, // 9{1,32,32,32,1,32,32,32}, // :{1,32,32,32,5,32,32,32}, // ;{4,45,1,32,1,45,4,32}, // <{4,4,4,32,1,1,1,32}, // ={1,45,4,32,4,45,1,32}, // >{1,6,2,32,32,7,32,32}, // ?{1,7,2,32,3,4,5,32}, // @{0,6,2,32,5,32,5,32}, // A{0,6,5,32,3,7,2,32}, // B{0,1,1,32,3,4,4,32}, // C{2,1,2,32,5,4,5,32}, // D{0,6,6,32,5,7,7,32}, // E{0,6,6,32,5,32,32,32}, // F{0,1,1,32,3,4,2,32}, // G{0,4,0,32,5,32,5,32}, // H{1,0,1,32,4,5,4,32}, // I{32,32,2,32,4,4,5,32}, // J{0,4,1,32,5,32,2,32}, // K{2,32,32,32,3,4,4,32}, // L{0,3,5,2,5,32,32,5}, // M{0,3,32,0,5,32,2,5}, // N{0,1,1,2,3,4,4,5}, // O{0,6,2,32,5,32,32,32}, // P{0,1,2,32,3,4,3,4}, // Q{0,6,5,32,5,32,2,32}, // R{0,6,6,32,7,7,5,32}, // S{1,2,1,32,32,5,32,32}, // T{0,32,2,32,3,4,5,32}, // U{2,32,0,32,3,4,5,32}, // V{0,32,32,2,3,0,2,5}, // W{3,4,5,32,0,1,2,32}, // X{3,4,5,32,32,5,32,32}, // Y{1,6,5,32,0,7,4,32}, // Z{5,1,32,32,2,4,32,32}, // [{3,4,32,32,32,1,2,32}, // \{1,3,32,32,4,0,32,32}, // ]{0,2,32,32,32,32,32,32}, // ^{32,32,32,32,4,4,4,32}, // _{2,32,32,32,32,32,32,32}, // `{32,4,4,32,255,7,2,32}, // a{2,32,32,32,3,6,5,32}, // b{32,32,32,32,0,6,6,32}, // c{32,32,0,32,0,6,5,32}, // d{4,45,4,32,3,7,7,32}, // e{0,6,32,32,3,32,32,32}, // f{255,6,2,32,4,4,5,32}, // g{2,32,32,32,3,1,2,32}, // h{6,32,32,32,3,32,32,32}, // i{32,32,6,32,4,4,5,32}, // j{5,4,32,32,5,2,32,32}, // k{2,32,32,32,3,32,32,32}, // l{32,32,32,32,0,3,5,2}, // m{32,32,32,32,0,1,2,32}, // n{32,4,32,32,255,7,255,32}, // o{0,6,255,32,5,32,32,32}, // p{255,6,2,32,32,32,3,32}, // q{32,4,4,32,0,32,32,32}, // r{4,45,45,32,6,6,255,32}, // s{4,0,4,32,4,5,32,32}, // t{32,32,32,32,3,4,0,32}, // u{4,4,32,32,3,5,32,32}, // v{32,32,32,32,5,4,3,32}, // w{4,32,4,32,7,255,7,32}, // x{0,4,2,32,32,4,5,32}, // y{45,45,4,32,255,6,6,32}, // z{4,0,1,32,1,3,4,32}, // {{32,255,32,32,32,255,32,32}, // |{1,2,4,32,4,5,1,32}, // }{4,1,4,1,32,32,32,32}, // ~{255,255,255,32,255,255,255,32} // solid block};#endif#ifdef mx300_bigfont1bstatic const uint8_t bigFont[96][8] = {{32,32,32,32,32,32,32,32},{255,32,32,32,7,32,32,32},{5,5,32,32,32,32,32,32},{4,255,4,255,1,255,1,255},{0,255,6,32,7,255,5,32},{1,32,4,1,4,1,32,4},{0,6,2,32,3,7,2,4},{5,32,32,32,32,32,32,32},{0,1,32,32,3,4,32,32},{1,2,32,32,4,5,32,32},{1,4,4,1,4,1,1,4},{4,255,4,32,1,255,1,32},{32,32,32,32,5,32,32,32},{4,4,4,32,32,32,32,32},{32,32,32,32,4,32,32,32},{32,32,4,1,4,1,32,32},{0,1,2,32,3,4,5,32},{1,2,32,32,32,255,32,32},{6,6,2,32,3,7,7,32},{6,6,2,32,7,7,5,32},{3,4,2,32,32,32,255,32},{255,6,6,32,7,7,5,32},{0,6,6,32,3,7,5,32},{1,1,2,32,32,0,32,32},{0,6,2,32,3,7,5,32},{0,6,2,32,32,32,255,32},{1,32,32,32,1,32,32,32},{1,32,32,32,5,32,32,32},{32,4,1,32,1,1,4,32},{4,4,4,32,1,1,1,32},{1,4,32,32,4,1,1,32},{1,6,2,32,32,7,32,32},{0,6,2,32,3,4,4,32},{0,6,2,32,255,32,255,32},{255,6,5,32,255,7,2,32},{0,1,1,32,3,4,4,32},{255,1,2,32,255,4,5,32},{255,6,6,32,255,7,7,32},{255,6,6,32,255,32,32,32},{0,1,1,32,3,4,2,32},{255,4,255,32,255,32,255,32},{1,255,1,32,4,255,4,32},{32,32,255,32,4,4,5,32},{255,4,5,32,255,32,2,32},{255,32,32,32,255,4,4,32},{0,3,5,2,255,32,32,255},{0,2,32,255,255,32,3,5},{0,1,2,32,3,4,5,32},{255,6,2,32,255,32,32,32},{0,1,2,32,3,4,255,4},{255,6,2,32,255,32,2,32},{0,6,6,32,7,7,5,32},{1,255,1,32,32,255,32,32},{255,32,255,32,3,4,5,32},{2,32,32,5,32,2,0,32},{255,32,32,255,3,0,2,5},{3,4,5,32,0,32,2,32},{3,4,5,32,32,255,32,32},{1,6,5,32,0,7,4,32},{255,1,32,32,255,4,32,32},{1,4,32,32,32,32,1,4},{1,255,32,32,4,255,32,32},{0,2,32,32,32,32,32,32},{32,32,32,32,4,4,4,4},{2,32,32,32,32,32,32,32},{32,4,4,32,255,7,2,32},{2,32,32,32,3,6,5,32},{32,32,32,32,0,6,6,32},{32,32,0,32,0,6,5,32},{4,45,4,32,3,7,7,32},{0,6,32,32,3,32,32,32},{255,6,2,32,4,4,5,32},{2,32,32,32,3,1,2,32},{6,32,32,32,3,32,32,32},{32,32,6,32,4,4,5,32},{5,4,32,32,5,2,32,32},{2,32,32,32,3,32,32,32},{32,32,32,32,0,3,5,2},{32,32,32,32,0,1,2,32},{32,4,32,32,255,7,255,32},{0,6,255,32,5,32,32,32},{255,6,2,32,32,32,3,32},{32,4,4,32,0,32,32,32},{4,45,45,32,6,6,255,32},{4,0,4,32,4,5,32,32},{32,32,32,32,3,4,0,32},{4,4,32,32,3,5,32,32},{32,32,32,32,5,4,3,32},{4,32,4,32,7,255,7,32},{0,4,2,32,32,4,5,32},{45,45,4,32,255,6,6,32},{4,0,1,32,1,3,4,32},{32,255,32,32,32,255,32,32},{1,2,4,32,4,5,1,32},{4,1,4,1,32,32,32,32},{255,255,255,32,255,255,255,32}};#endifvoid setup() { autoScroll = false; shifted = false; writebig = false; currcol = 0; currline = 0; // Set up the LCD's number of columns and rows: lcd.begin(cols, rows); // Setup the character segments used by the bigfont for (int n = 0; n < 8; n++) lcd.createChar(n, charpixels[n]); // Print a message to the LCD. lcd.print("hello, world!"); delay(1000); lcd.clear(); shifted = false; currcol = 0; currline = 0; }void writeBig(uint8_t upper, uint8_t lower) { // Write two characters in one column to form part of bigfont character if (shifted & autoScroll ) lcd.scrollDisplayLeft(); lcd.setCursor(currcol % 40, 0); lcd.write(upper); lcd.setCursor(currcol % 40, 1); lcd.write(lower); currcol++; if ((currcol >= cols) & autoScroll ) shifted = true;}void writeIt(uint8_t value) { // "shifted" keeps track of whether we've already printed past the end of the visible display area // - if so we leftshift the display with each new character. // This allows us to print _numcols visible characters then start scrolling, and continue scrolling forever // even once the cursor has wrapped around to 0 (only 40 characters in LCD line buffer) if (!writebig) { // Just write normal character but keep track of column in case we will be scrolling if (shifted & autoScroll ) lcd.scrollDisplayLeft(); lcd.write(value); currcol++; if ((currcol >= cols) & autoScroll ) shifted = true; if ((currcol % 40) == 0) { currcol = 0; lcd.setCursor(currcol, currline); } } else { // Write two halves of the bigfont character unless it is a blank column // (allows for variable width characters) if ((value >= ' ') & (value < 128)) { // have only defined ASCII characters 32 to 127 for (int i = 0; i < 4; i++ ) { // upto 4 columns per character if ((bigFont[value - 32][i] != 32) | (bigFont[value-32][i+4] != 32)) { //not a blank column in character writeBig(bigFont[value - 32][i], bigFont[value - 32][i+4]); } } // If the character to be printed was a space we didn't actually print anything, so print one now if (value==' ') writeBig(' ', ' '); // Print a blank gap between characters writeBig(' ', ' '); } currcol = currcol % 40; lcd.setCursor(currcol, currline); }}void loop() { // If you want the display to autoscroll, set autoScroll to true and set "shifted" to false and // "currcol" to 0 whenever you lcd.clear or lcd.home the display. // You can set "currcol" to reposition the cursor, but using it with autoScroll can get confusing. autoScroll = false; unsigned long start, count; start = count = millis()/1000; writebig = true; while ((count-start) < 12) { currcol = 0; writeIt(char('0'+((count / 1000))% 10)); writeIt(char('0'+((count / 60)) % 10)); writeIt(':'); writeIt(char('0'+((count % 60)/10) % 10)); writeIt(char('0'+((count % 60)) % 10)); delay(955); count = millis() / 1000; } /* delay(500); lcd.clear(); shifted = false; currcol = 0; currline = 0; //unsigned long start, count; start = count = millis()/1000; writebig = true; while ((count-start) < 12) { currcol = 3; writeIt(char('0' + ((count / 1000) % 10))); writeIt(char('0' + ((count / 100) % 10))); writeIt(char('0' + ((count / 10) % 10))); writeIt(char('0' + ((count / 1) % 10))); delay(955); count = millis() / 1000; } */ lcd.clear(); shifted = false; currcol = 0; currline = 0; autoScroll = true; char str3[45] = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."; for (int i = 0; i < 45; i++) { writeIt(str3[i]); delay(300); } delay(3000); lcd.clear(); shifted = false; currcol = 0; currline = 0; char str4[53] = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"; for (int i = 0; i < 13; i++) { for (int j = 0; j < 4; j++) writeIt(str4[i * 4 + j]); delay(300); lcd.clear(); shifted = false; currcol = 0; currline = 0; } //delay(3000); lcd.clear(); shifted = false; currcol = 0; currline = 0; autoScroll = true; char str[45] = "The quick brown fox jumps over the lazy dog."; for (int i = 0; i < 45; i++) { writeIt(str[i]); delay(300); } delay(3000); lcd.clear(); shifted = false; currcol = 0; currline = 0; autoScroll = true; for (int i = 0; i < 1000; i++) { writeIt(char(' ' + (i % 96))); delay(300); } delay(3000); lcd.clear(); shifted = false; currcol = 0; currline = 0;}

    View Instructable »
  • tony-arduino commented on mpilchfamily's instructable Custom Large Font for 16x2 LCDs5 months ago
    Custom Large Font for 16x2 LCDs

    I originally found Michael's rounded font on the forum he mentioned above and hadn't seen this instructable. I found an LCD which had no gap between the two rows of characters which seemed to be just the thing for a double height font, so implemented my own version with chunky block characters, but took another look at the rounded font and found it worked better. So I created a full 96 character ASCII character set using the rounded font elements. The LCD module I am using has a few extra predefined block characters which helped when creating the lowercase characters, but I also created a usable lowercase set that should be compatible with most standard LCDs. See my one at http://projects.scorchingbay.nz/dokuwiki/arduino/m... The alternate fonts are defined in http://projects.scorc...

    see more »

    I originally found Michael's rounded font on the forum he mentioned above and hadn't seen this instructable. I found an LCD which had no gap between the two rows of characters which seemed to be just the thing for a double height font, so implemented my own version with chunky block characters, but took another look at the rounded font and found it worked better. So I created a full 96 character ASCII character set using the rounded font elements. The LCD module I am using has a few extra predefined block characters which helped when creating the lowercase characters, but I also created a usable lowercase set that should be compatible with most standard LCDs. See my one at http://projects.scorchingbay.nz/dokuwiki/arduino/m... The alternate fonts are defined in http://projects.scorchingbay.nz/dokuwiki/_media/ar....(Not sure whether the GIF image I added here will display properly)

    A minor point with Dale's code, the ASCII space character is 20hex, so 32 decimal, or octal code "\040" not "\024", but on many LCDs character 20 is undefined so it works fine :-)

    View Instructable »
  • Salvaging Liquid Crystal Displays (LCDs)

    Probably a bit late to be helpful for you, but maybe someone else will find this thread ... The LCD has a 3 wire SPI interface 1-DATA, 2-CLK, 3-STB, 4-GND, 5-+5V, 6-GND. So the third pin, STB, is basically a device select signal. Pin 4 (or 6) may also be a signal line, but is grounded on that board. There's a little more info, including an initialisation sequence at http://projects.scorchingbay.nz/dokuwiki/electronic/lcd/b53K4631. The CoG controller is basically a serial SPI version of an hd44780 type chip. (SEN1 and SEN2 are for mechanical paper-out etc switches, PNL7 is a custom programmed IC, basically throw away the B53K463-1 PCB but unsolder the flex cable socket first!)

    View Instructable »