9 years, 9 months ago.

Big fonts on Text LCDs?

Hi all,

Is it possible to import that;

http://www.instructables.com/id/Custom-Large-Font-For-16x2-LCDs/step5/Arduino-Sketch/

to mbed? Or is there a library exist for large fonts on Text LCD displays?

..

posted by Özgür Kolay 20 Mar 2015

1 Answer

9 years, 9 months ago.

I dont think there is an mbed lib for big text LCD fonts at the moment. However, this could be created as a derived lib from the enhanced TextLCD lib. That lib has the methods needed to set User Defined Characters. The UDCs are the basic elements from which the big fonts are made. You will need some new methods to convert a string into big chars and display them at the right position on a multi-line text LCD. You can probably simply port the big font code from your example into a number of calls of TextLCD methods.

Accepted Answer

I think that instructables guy already wrote these methods for Ardunio.. So I asked if its posibble to convert that library for mbed?

posted by Özgür Kolay 20 Mar 2015

It will take a bit of work, maybe some ''find and replace'', but all functions are available:

//UDC defines
byte LT[8] = 
{
  B00111,
  B01111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111
};

//redefine LT etc in this format:
const char udc_LT[]  = {0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}; 

// setup
void setup()
{
  // assignes each segment a write number
  lcd.createChar(8,LT);
  lcd.createChar(1,UB);
  lcd.createChar(2,RT);
  lcd.createChar(3,LL);
  lcd.createChar(4,LB);
  lcd.createChar(5,LR);
  lcd.createChar(6,UMB);
  lcd.createChar(7,LMB);

  // sets the LCD's rows and colums:
  lcd.begin(0, 2);
}

// modify setup
    lcd.setUDC(0, (char *) udc_LT); 
etc..

//code to display custom char
void custom0O()
{ // uses segments to build the number 0
  lcd.setCursor(x, 0); 
  lcd.write(8);  
  lcd.write(1); 
  lcd.write(2);
  lcd.setCursor(x, 1); 
  lcd.write(3);  
  lcd.write(4);  
  lcd.write(5);
}

// modify code to display
void custom0O()
{ // uses segments to build the number 0
  lcd.locate(x, 0); 
  lcd.putc(0); 
  lcd.putc(1); 
  lcd.putc(2);
  lcd.locate(x, 1); 
  lcd.putc(3);  
  lcd.putc(4);  
  lcd.putc(5);
}
posted by Wim Huiskamp 20 Mar 2015