Large Alphanumeric on LCD

They look nice.

I've been thinking about that but only having 8 custom characters to work with keeps things limited. If there was a way to flip the character horizontally and vertically then it could be possible. Then then i would only need 3 custom segments to handle the numbers.

Maybe i need to come up with a way i could redefine the characters on the fly. Like having multiple versions of the setup that can be called too to redefine the available segments.

You can redefine on the fly can you not. Call a code section to redifine and it should be simple enough.

Mowcius

You can redefine on the fly can you not.

You can, but (there's always a "but" right?) then characters already displayed and using the previously defined pattern will change. In other words you can only have 8 different patterns visible at the same time. If you change one - all characters relying on this pattern will change too.

A solution to this would be a graphics display where every pixel is addressable. Unfortunately they cost a lot more.

I'd like to get a decent sized graphic display. Is there any one that you guys would recommend over another? Any particular controller chip i should be looking out for?

I will be redefining the 'M' and the 'W' so they are not as wide. They will be similar to the 'N'.

you always have a full block at 254 or 255, the other is then the empty block.

so it would be possible to make the D and other letters a little smoother :slight_smile:

I figured there was i just didn't know how to call it up. When i eventually get home i'll work on that. I'll be stuck here till at least Thursday morning cause of snow.

You can, but (there's always a "but" right?) then characters already displayed and using the previously defined pattern will change. In other words you can only have 8 different patterns visible at the same time. If you change one - all characters relying on this pattern will change too.

Yeah, hadn't thought of that.

Can you display all of those?

Then you would only need a few custom characters to have lots of smooth letters.

I'd like to get a decent sized graphic display.

Yeah me too.

Mowcius

I have updated the library of characters. The letters now look allot better. There is also a '?' and '!'. I've also revised the code to scroll the letters. Unfortunately i couldn't get it to scroll the entire lineup of characters all at once. The buffer for it isn't big enough. I had to break it down into 4 segments.

Video will be posted later. As will the code if anyone wants it.

I'd like to get a decent sized graphic display ...

This is my favorite:
http://ledsee.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=244&category_id=23&option=com_virtuemart&Itemid=27

This 128x64 LCD works with a single 5V supply and comes with a prefitted 4-wire touchscreen. The combination of LCD/touchscreen is good for prototype/one-off designs (no keypad needed). You get 8 lines with 21 characters (5x7) or 6 lines of text plus 4 large (good-to-push) buttons.

Add a top plate of brushed aluminium with a cutout for the display area and the finished project looks excellent and works well.

This is my favorite:
http://ledsee.com/index.php?page=shop.product_details&flypage=flypage.tpl&produc...

That is nice. I have been looking for a graphic LCD to fit under my DS touch screen for a while now but that one takes the biscuit being all in one and at a decent price!

Mowcius

Here is my first ever video posted online. One small change was made just after taking the video and while waiting for the upload to complete. I redefined the '5' a bit to differentiate it from the 'S'. The top left segment of the '5' has been replaced by a solid block. BTW that is in fact an official Arduino i just keep my motor shield plugged in all the time.

Mike

What do the LL, LB, etc stand for?

And yes I would like the updated code.

Thanks

Mark

Yeah I'd be interested in the updates code again too.

I have not got around to fiddling with the library myself yet but that will come this next week.

Mowcius

The LL, LT, UB, ect... are just abbreviations to help me designate which segment was which when referencing the large '0'.

LT= left top
UB= upper bar
RT= right top
LL= lower left
LB= lower bar
LR= lower right
UMB= upper middle bars(upper middle section of the '8')
LMB= lower middle bars(lower middle section of the '8')

Any label can go there. Then with

lcd.createChar(0,LT);

It takes that array and stores it as one of the 8 available custom characters. Then you use the

lcd.write(0);

to display that custom character on the LCD.

Here is the updated scrolling characters code. It will span 2 posts.

/*
A set of custom made large numbers for a 16x2 LCD using the 
 LiquidCrystal librabry. Works with displays compatible with the 
 Hitachi HD44780 driver. 
 
 The Cuicuit:
 LCD RS pin to D12
 LCD Enable pin to D11
 LCD D4 pin to D5
 LCD D5 pin to D4
 LCD D6 pin to D3
 LCD D7 pin to D2
 LCD Vee tied to a pot to control brightness
 LCD Vss and R/W tied to ground
 LCD Vcc to +5V
 LCD pin 15 tied to pushbutton for control of backlight
 
 Made by Michael Pilcher
 2/9/2010
 */

// include the library
#include <LiquidCrystal.h>

// initialize the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int x = 0;
// the 8 arrays that form each segment of the custom numbers
byte LT[8] = 
{
  B00111,
  B01111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111
};
byte UB[8] =
{
  B11111,
  B11111,
  B11111,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000
};
byte RT[8] =
{
  B11100,
  B11110,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111
};
byte LL[8] =
{
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B01111,
  B00111
};
byte LB[8] =
{
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B11111,
  B11111,
  B11111
};
byte LR[8] =
{
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11110,
  B11100
};
byte UMB[8] =
{
  B11111,
  B11111,
  B11111,
  B00000,
  B00000,
  B00000,
  B11111,
  B11111
};
byte LMB[8] =
{
  B11111,
  B00000,
  B00000,
  B00000,
  B00000,
  B11111,
  B11111,
  B11111
};



void setup()
{
  // assignes each segment a write number
  lcd.createChar(0,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(16, 2);

}

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

void custom1()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(2);
  lcd.setCursor(x+1,1);
  lcd.write(5);
}

void custom2()
{
  lcd.setCursor(x,0);
  lcd.write(6);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(3);
  lcd.write(7);
  lcd.write(7);
}

void custom3()
{
  lcd.setCursor(x,0);
  lcd.write(6);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(7);
  lcd.write(7);
  lcd.write(5); 
}

void custom4()
{
  lcd.setCursor(x,0);
  lcd.write(3);
  lcd.write(4);
  lcd.write(2);
  lcd.setCursor(x+2, 1);
  lcd.write(5);
}

void custom5()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(6);
  lcd.setCursor(x, 1);
  lcd.write(7);
  lcd.write(7);
  lcd.write(5);
}

void custom6()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(6);
  lcd.write(6);
  lcd.setCursor(x, 1);
  lcd.write(3);
  lcd.write(7);
  lcd.write(5);
}

void custom7()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(1);
  lcd.write(2);
  lcd.setCursor(x+1, 1);
  lcd.write(0);
}

void custom8()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(3);
  lcd.write(7);
  lcd.write(5);
}

void custom9()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x+2, 1);
  lcd.write(5);
}

void customA()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(255);
}

void customB()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(5);
  lcd.setCursor(x, 1);
  lcd.write(255);
  lcd.write(7);
  lcd.write(2);
}

void customC()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(1);
  lcd.write(1);
  lcd.setCursor(x,1);
  lcd.write(3);
  lcd.write(4);
  lcd.write(4);
}

void customD()
{
  lcd.setCursor(x, 0); 
  lcd.write(255);  
  lcd.write(1); 
  lcd.write(2);
  lcd.setCursor(x, 1); 
  lcd.write(255);  
  lcd.write(4);  
  lcd.write(5);
}

void customE()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(6);
  lcd.setCursor(x, 1);
  lcd.write(255);
  lcd.write(7);
  lcd.write(7); 
}

void customF()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(6);
  lcd.setCursor(x, 1);
  lcd.write(255);
}

void customG()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(1);
  lcd.write(1);
  lcd.setCursor(x,1);
  lcd.write(3);
  lcd.write(4);
  lcd.write(2);
}

void customH()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(4);
  lcd.write(255);
  lcd.setCursor(x, 1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(255); 
}

void customI()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(255);
  lcd.write(1);
  lcd.setCursor(x,1);
  lcd.write(4);
  lcd.write(255);
  lcd.write(4);
}

void customJ()
{
  lcd.setCursor(x+2,0);
  lcd.write(255);
  lcd.setCursor(x,1);
  lcd.write(4);
  lcd.write(4);
  lcd.write(5);
}

void customK()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(4);
  lcd.write(5);
  lcd.setCursor(x,1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(2); 
}

void customL()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.setCursor(x,1);
  lcd.write(255);
  lcd.write(4);
  lcd.write(4);
}

void customM()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(3);
  lcd.write(5);
  lcd.write(2);
  lcd.setCursor(x,1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(254);
  lcd.write(255);
}

void customN()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(2);
  lcd.write(254);
  lcd.write(255);
  lcd.setCursor(x,1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(3);
  lcd.write(5);
}

void customP()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(255);
}

void customQ()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(1);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(3);
  lcd.write(4);
  lcd.write(255);
  lcd.write(4);
}

void customR()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x,1);
  lcd.write(255);
  lcd.write(254);
  lcd.write(2); 
}

void customS()
{
  lcd.setCursor(x,0);
  lcd.write(0);
  lcd.write(6);
  lcd.write(6);
  lcd.setCursor(x, 1);
  lcd.write(7);
  lcd.write(7);
  lcd.write(5);
}

void customT()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(255);
  lcd.write(1);
  lcd.setCursor(x,1);
  lcd.write(254);
  lcd.write(255);
}

void customU()
{
  lcd.setCursor(x, 0); 
  lcd.write(255);  
  lcd.write(254); 
  lcd.write(255);
  lcd.setCursor(x, 1); 
  lcd.write(3);  
  lcd.write(4);  
  lcd.write(5);
}

void customV()
{
  lcd.setCursor(x, 0); 
  lcd.write(3);  
  lcd.write(254);
  lcd.write(254); 
  lcd.write(5);
  lcd.setCursor(x+1, 1); 
  lcd.write(2);  
  lcd.write(0);
}

void customW()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.write(254);
  lcd.write(254);
  lcd.write(255);
  lcd.setCursor(x,1);
  lcd.write(3);
  lcd.write(0);
  lcd.write(2);
  lcd.write(5);
}

void customX()
{
  lcd.setCursor(x,0);
  lcd.write(3);
  lcd.write(4);
  lcd.write(5);
  lcd.setCursor(x,1);
  lcd.write(0);
  lcd.write(254);
  lcd.write(2); 
}

void customY()
{
  lcd.setCursor(x,0);
  lcd.write(3);
  lcd.write(4);
  lcd.write(5);
  lcd.setCursor(x+1,1);
  lcd.write(255);
}

void customZ()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(6);
  lcd.write(5);
  lcd.setCursor(x, 1);
  lcd.write(0);
  lcd.write(7);
  lcd.write(4);
}

void customqm()
{
  lcd.setCursor(x,0);
  lcd.write(1);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(254);
  lcd.write(7);
}

void customsm()
{
  lcd.setCursor(x,0);
  lcd.write(255);
  lcd.setCursor(x, 1);
  lcd.write(7);
}

code continued

void letters1()
{
  customA();
  x = x + 4;
  customB();
  x = x + 4;
  customC();
  x = x + 4;
  customD();
  x = x + 4;
  customE();
  x = x + 4;
  customF();
  x = x + 4;
  customG();
  x = x + 4;
  customH();
  x = x + 4;
  customI();
  x = x + 4;
  customJ();
  delay(500);
}

void letters2()
{
  customK();
  x = x + 4;
  customL();
  x = x + 4;
  customM();
  x = x + 5;
  customN();
  x = x + 5;
  custom0O();
  x = x + 4;
  customP();
  x = x + 4;
  customQ();
  x = x + 5;
  customR();
  x = x + 4;
  customS();
  delay(500);
}

void letters3()
{
  customT();
  x = x + 4;
  customU();
  x = x + 4;
  customV();
  x = x + 5;
  customW();
  x = x + 5;
  customX();
  x = x + 4;
  customY();
  x = x + 4;
  customZ();
  x = x + 4;
  customqm();
  x = x + 4;
  customsm();
  delay(500);
}

void numbers()
{
  custom0O();    // displays custom 0 on the LCD
  x = x + 4;    // sifts cursor over 4 columns
  custom1();
  x = x + 4;
  custom2();
  x = x + 4;
  custom3();
  x = x + 4;
  custom4();
  x = x + 4;
  custom5();
  x = x + 4;
  custom6();
  x = x + 4;
  custom7();
  x = x + 4;
  custom8();
  x = x + 4;
  custom9();
  delay(500);
}



void loop()
{
  letters1();
  for (int positionCounter = 0; positionCounter < 24; positionCounter++) {
    lcd.scrollDisplayLeft();
    delay(500);
  }
  x = 0;
  lcd.clear();
  delay(500);
  letters2();
  for (int positionCounter = 0; positionCounter < 23; positionCounter++) {
    lcd.scrollDisplayLeft();
    delay(500);
  }
  x = 0;
  lcd.clear();
  delay(500);
  letters3();
  for (int positionCounter = 0; positionCounter < 23; positionCounter++) {
    lcd.scrollDisplayLeft();
    delay(500);
  }
  x = 0;
  lcd.clear();
  delay(500);
  numbers();
  for (int positionCounter = 0; positionCounter < 24; positionCounter++) {
    lcd.scrollDisplayLeft(); 
    delay(500);
  }
  x = 0;
  lcd.clear();
  delay(500);
}

It's looking good, digimike!

I think the next display i get will be this one.

Then the real fun begins. I'll start porting some of the games i made on my old TI-85 graphing calculator. Shouldn't be to hard to go from TI-Basic to the Arduino's C.

It's looking good, digimike!

Agreed.

I will take a more detailed look tomorrow :slight_smile:

Mowcius

How easy would this be to use on a 4x20 LCD?
I don't have a 2x16...
What would need to be changed so you could print on 2 big lines(2 lines each)?

:-?

You may want to look at:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245352653

There are more. Just g**gle it :slight_smile:

Mowcius

Your not limited to a 16x2 display. As it is the code will just use the top 2 lines of your display. On a 20x4 display you could have 2 lines of large characters. Your own personal code using the segments i have defined will have to designate when to set the cursor to line 3 for the next row.

In the sections that define the layout of each character you'll want to change it from this.

void custom2()
{
  lcd.setCursor(x,0);
  lcd.write(6);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, 1);
  lcd.write(3);
  lcd.write(7);
  lcd.write(7);
}

To this:

void custom2()
{
  lcd.setCursor(x,y);
  lcd.write(6);
  lcd.write(6);
  lcd.write(2);
  lcd.setCursor(x, y+1);
  lcd.write(3);
  lcd.write(7);
  lcd.write(7);
}

The second setCursor() across all of them will have to be...

lcd.setCursor(x, y+2);

This way the bottom half of the letter will be in the right position.

If you wanted to have a character take up all 4 lines then you would need to redefine all the characters. Which wouldn't be all that hard to do. The custom segments all stay the same they just get laid out a bit differently. It would look funny but it can be done.