Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example 7 Liquid Crystal Display

Similar presentations


Presentation on theme: "Example 7 Liquid Crystal Display"— Presentation transcript:

1 Example 7 Liquid Crystal Display
Lecture L4.1

2 miniDragon+ 2 pushbutton switches LCD Header Serial cable A/D Pot I/O headers Run/Load switch Reset button 7-segment display Power plug Keypad header

3

4 LCD on miniDragon+ Board

5 RS, R/W, and E Signals

6

7

8

9

10 Example 7 // Example 7: LCD Display
#include <hidef.h> /* common defines and macros */ #include <mc9s12dp256.h> /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" void main(void) { char* q1; char* q2; char* q3; char* q4; q1 = "Programming"; q2 = "Microcontrollers"; q3 = "is"; q4 = "FUN"; PLL_init(); // set system clock frequency to 24 MHz

11 Example 7 (cont.) lcd_init(); // enable lcd set_lcd_addr(0x04);
type_lcd(q1); // write q1 - Programming set_lcd_addr(0x42); type_lcd(q2); // write q2 - Microcontrollers set_lcd_addr(0x1D); type_lcd(q3); // write q3 - is set_lcd_addr(0x5C); type_lcd(q4); // write q4 - FUN for(;;){ } // wait forever }


Download ppt "Example 7 Liquid Crystal Display"

Similar presentations


Ads by Google