The Earth LCD ezLCD+103 is a 3.5" 320x240, 24 bit Color TFT LCD touch screen with a built-in GPU. Unlike other screens, the brains are built in so the user need not worry about complex algorithms. This makes the display easy and intuitive to use. Anyone who can send data serially in a wide variety of interfaces can use the ezLCD+103.
The Sparkfun BOB-12009 is a bi-polar logic level converter. It allows us to drive the ezLCD+103 from the ATMega128 since the ezLCD+103 utilizes 3.3V logic rather than the 5V logic of the ATmega128 The Hirose DF11-32DS is a 3 2-pin 2mm connector which the ezLCD+103 uses to interact with the outside world.
Once the display is properly connected, the user may begin to code.
Using this library is simple.
The following code snippet illustrates how to write a simple program for this display using the ATMega128. Of course, this snippet only illustrates a small preview of the functions in this library. Please explore the rest of this page for an in-depth overview of this library.
This code snippet generates the simple menu shown at the top of this page. It performs simple tasks such as writing characters to a text box and switching between menus.
#include <iom128.h>
#include <intrinsics.h>
#include <avr_macros.h>
#include <stdio.h>
#define ZERO 0
#define ONE 1
#define TWO 2
#define THREE 3
#define FOUR 4
#define FIVE 5
#define SIX 6
#define SEVEN 7
#define EIGHT 8
#define NINE 9
#define STAR 10
#define POUND 11
#define START 12
#define STOP 13
#define CALIBRATE 14
void draw_buttons();
int main (void)
{
__delay_cycles(10000);
draw_buttons();
while(1)
{
if(button == CALIBRATE)
{
}
if(button <= NINE)
printf("%d",button);
if(button == STAR)
{
}
if(button == POUND)
{
}
if(button == STOP)
{
EZLCD_BUTTON_UP,
CALIBRATE_BUTTON_EZLCD_BUTTON_UP_INDEX,
CALIBRATE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
CALIBRATE_BUTTON_DISABLED_INDEX,
215,
115,
CALIBRATE_BUTTON_WIDTH,
CALIBRATE_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
START_BUTTON_EZLCD_BUTTON_UP_INDEX,
START_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
START_BUTTON_DISABLED_INDEX,
215,
5,
START_BUTTON_WIDTH,
START_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
STOP_BUTTON_EZLCD_BUTTON_UP_INDEX,
STOP_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
STOP_BUTTON_DISABLED_INDEX,
215,
60,
STOP_BUTTON_WIDTH,
STOP_BUTTON_HEIGHT);
}
if(button == START)
{
draw_buttons();
}
}
}
void draw_buttons()
{
draw_number_pad(5,80);
EZLCD_BUTTON_UP,
START_BUTTON_EZLCD_BUTTON_UP_INDEX,
START_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
START_BUTTON_DISABLED_INDEX,
215,
5,
START_BUTTON_WIDTH,
START_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
STOP_BUTTON_EZLCD_BUTTON_UP_INDEX,
STOP_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
STOP_BUTTON_DISABLED_INDEX,
215,
60,
STOP_BUTTON_WIDTH,
STOP_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
CALIBRATE_BUTTON_EZLCD_BUTTON_UP_INDEX,
CALIBRATE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
CALIBRATE_BUTTON_DISABLED_INDEX,
215,
115,
CALIBRATE_BUTTON_WIDTH,
CALIBRATE_BUTTON_HEIGHT);
}
{
EZLCD_BUTTON_UP,
ZERO_BUTTON_EZLCD_BUTTON_UP_INDEX,
ZERO_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
ZERO_BUTTON_DISABLED_INDEX,
num_pad_x + 50 + 5,
num_pad_y + 105 + 15,
ZERO_BUTTON_WIDTH,
ZERO_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
ONE_BUTTON_EZLCD_BUTTON_UP_INDEX,
ONE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
ONE_BUTTON_DISABLED_INDEX,
num_pad_x,
num_pad_y,
ONE_BUTTON_WIDTH,
ONE_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
TWO_BUTTON_EZLCD_BUTTON_UP_INDEX,
TWO_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
TWO_BUTTON_DISABLED_INDEX,
num_pad_x + 50 + 5,
num_pad_y,
TWO_BUTTON_WIDTH,
TWO_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
THREE_BUTTON_EZLCD_BUTTON_UP_INDEX,
THREE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
THREE_BUTTON_DISABLED_INDEX,
num_pad_x + 100 + 10,
num_pad_y,
THREE_BUTTON_WIDTH,
THREE_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
FOUR_BUTTON_EZLCD_BUTTON_UP_INDEX,
FOUR_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
FOUR_BUTTON_DISABLED_INDEX,
num_pad_x,
num_pad_y + 35 + 5,
FOUR_BUTTON_WIDTH,
FOUR_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
FIVE_BUTTON_EZLCD_BUTTON_UP_INDEX,
FIVE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
FIVE_BUTTON_DISABLED_INDEX,
num_pad_x + 50 + 5,
num_pad_y + 35 + 5,
FIVE_BUTTON_WIDTH,
FIVE_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
SIX_BUTTON_EZLCD_BUTTON_UP_INDEX,
SIX_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
SIX_BUTTON_DISABLED_INDEX,
num_pad_x + 100 + 10,
num_pad_y + 35 + 5,
SIX_BUTTON_WIDTH,
SIX_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
SEVEN_BUTTON_EZLCD_BUTTON_UP_INDEX,
SEVEN_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
SEVEN_BUTTON_DISABLED_INDEX,
num_pad_x,
num_pad_y + 70 + 10,
SEVEN_BUTTON_WIDTH,
SEVEN_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
EIGHT_BUTTON_EZLCD_BUTTON_UP_INDEX,
EIGHT_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
EIGHT_BUTTON_DISABLED_INDEX,
num_pad_x + 50 + 5,
num_pad_y + 70 + 10,
EIGHT_BUTTON_WIDTH,
EIGHT_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
NINE_BUTTON_EZLCD_BUTTON_UP_INDEX,
NINE_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
NINE_BUTTON_DISABLED_INDEX,
num_pad_x + 100 + 10,
num_pad_y + 70 + 10,
NINE_BUTTON_WIDTH,
NINE_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
STAR_BUTTON_EZLCD_BUTTON_UP_INDEX,
STAR_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
STAR_BUTTON_DISABLED_INDEX,
num_pad_x,
num_pad_y + 105 + 15,
STAR_BUTTON_WIDTH,
STAR_BUTTON_HEIGHT);
EZLCD_BUTTON_UP,
POUND_BUTTON_EZLCD_BUTTON_UP_INDEX,
POUND_BUTTON_EZLCD_BUTTON_DOWN_INDEX,
POUND_BUTTON_DISABLED_INDEX,
num_pad_x + 100 + 10,
num_pad_y + 105 + 15,
POUND_BUTTON_WIDTH,
POUND_BUTTON_HEIGHT);
}