Pages: 1 [2] 3 4   Go Down
Author Topic: Large Alphanumeric on LCD  (Read 29437 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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'.
Logged

Austria
Offline Offline
Sr. Member
****
Karma: 3
Posts: 260
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley
Logged


MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

http://www.asciitable.com/
Can you display all of those?

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

Quote
I'd like to get a decent sized graphic display.
Yeah me too.

Mowcius

Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


« Last Edit: February 11, 2010, 11:48:47 am by digimike » Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
[media]http://www.youtube.com/watch?v=JamLLtJmQ50[/media]
« Last Edit: February 11, 2010, 09:18:04 pm by digimike » Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mike

What do the LL, LB, etc stand for?

And yes I would like the updated code.

Thanks

Mark
« Last Edit: February 11, 2010, 10:56:51 pm by msproul » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
lcd.createChar(0,LT);
It takes that array and stores it as one of the 8 available custom characters. Then you use the
Code:
lcd.write(0);
to display that custom character on the LCD.

Here is the updated scrolling characters code. It will span 2 posts.
Code:
/*
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);
}

« Last Edit: February 12, 2010, 01:21:18 pm by digimike » Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

code continued
Code:
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);
}
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's looking good, digimike!
Logged

MD, USA
Offline Offline
God Member
*****
Karma: 2
Posts: 663
A jack of all trades and a master of none!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.sparkfun.com/commerce/product_info.php?products_id=710

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.
Logged

Pages: 1 [2] 3 4   Go Up
Jump to: