PROJECT 2 - GRAPHIC LCD DISPLAY

PROJECT 2 - GRAPHIC LCD DISPLAY

PROJECT 2

GRAPHIC LCD DISPLAY

Back to Project 1                                                                                                    Go to Project 3

Arduino Duemilanove have come with a Graphic LCD shield which allow allow user to play with more pixel besides LCD. This shield have 48×84 pixel resolution. If your project need more information to display, this LCD shield can apparently meet your needs. It is able to display English, Chinese, even images.

———————————————————————————————————————————————————-

COMPONENT NEEDED

———————————————————————————————————————————————————-

ARDUINO -GRAPHIC LCD SHIELD

———————————————————————————————————————————————————-

CONNECTION

———————————————————————————————————————————————————-

Referring to the Figure above, the GLCD are only required to plug into Arduino Duemilanove then put in the coding, the shield are ready to display.

———————————————————————————————————————————————————-

ADDITIONAL INFORMATION

———————————————————————————————————————————————————-
For Arduino- GLD shield, It also integrates a 5 DOF joystick. The shield has 6 Digital IO and 5 Analog IO. Besides that, we may control the backlight by just use digitalWrite(7, HIGH/LOW) to turn it on and off. Don’t forget to put pinMode(7, OUTPUT) in void setup();.

Well, reading the joystick position is accomplished via analogRead(0);. It returns the following values as such:

  • Up – 505
  • Down – 0
  • Left – 740
  • Right – 330
  • pressed in – 144
  • Idle (no action) – 1023

———————————————————————————————————————————————————-

CODE OVERVIEW

———————————————————————————————————————————————————-

int adc_key_in;
Define the adc_key_in as a storage space of integer.

int joy_stick = 0;
Define the joy_stick I/O as analog port 0.

int adc_key_val[5] = {50,200,400,600,800};
Initial the joy stick ADC value.

#define LCD_Backlight 7
Define the LCD_Backlight pin as ditial pin 7.

#define NUM_KEYS 5
Define the total number of key is 5.

lcd.LCD_init();
Graphic LCD Initialize.

Lcd.LCD_clear();
Clear the GLCD screen.

pinMode(LCD_Backlight, OUTPUT);
Make the LCD_Backlight pin as output.

lcd.LCD_draw_bmp_pixel(2,1,cytron,80,24);
Display the picture in Bitmap format in (2nd row, 1st column, cytron logo, picture’s width, picture’s height).

lcd.LCD_write_string(0,a,“01234567890123”,MENU_NORMAL);
Write a string of number in every row.

lcd.LCD_write_string_big(0,0,“012345”,MENU_NORMAL);
Write a string of number in big font size.

Back to Project 1                                                                                                Go to Project 3

———————————————————————————————————————————————————-

ATTACHMENT

1.P2 User Manual.pdf
2.Project_2_code.zip

BUY