FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    LCD display module 1602 driver program source code

     

    "LCD module 1602 driver source code //lcd1602 drive program for 51 mcu//designed by Wangchao//2006-6-14 #i nclude ""reg52.h""/********************************************************************///lcd part#define LINE1 0#define LINE2 1#define LINE1_ HEAD 0x80#define LINE2_ HEAD 0xC0#define LCD_ DELAY_ TIME 40#define DATA_ MODE 0x38#define OPEN_ SCREEN 0x0C#define DISPLAY_ ADDRESS 0x80#define CLEARSCREEN LCD_ en_ command(0x01)//common part #define HIGH 1#define LOW 0#define TRUE 1#define ZERO 0 /*******************************************************************///change this part at different board#define LCDIO P2sbit LCD1602_ RS=P0^7; // data command select 1 data 0 command pin 4 sbit LCD1602_ RW=P0^6; // read write select 1 read 0 write pin 5sbit LCD1602_ EN=P0^5; // LCD enable signal pin 6 /********************************************************************/void LCD_ delay(void);// lcd delay void LCD_ en_ command(unsigned char command);// write command void LCD_ en_ dat(unsigned char temp);// write data void LCD_ set_ xy( unsigned char x, unsigned char y );// set display address void LCD_ write_ char( unsigned x,unsigned char y,unsigned char dat);// write lcd a character void LCD_ write_ string(unsigned char X,unsigned char Y,unsigned char *s);// write lcd string void LCD_ init(void);// lcd iniTIze /********************************************************************/void delay_ nms(unsigned int n);// delay /********************************************************************/void main(void){ LCD_ init(); while(TRUE ) { CLEARSCREEN; delay_ nms(2); LCD_ write_ string(0,LINE1,""Wellcome to DLUT""); LCD_ write_ string(0,LINE2,""www.dlut.edu.cn!""); delay_ nms(500); CLEARSCREEN; delay_ nms(2); LCD_ write_ string(0,LINE1,"" lcd test ""); LCD_ write_ string(0,LINE2,"" successful! ""); delay_ nms(500); CLEARSCREEN; delay_ nms(2); LCD_ write_ string(0,LINE1,"" I'm WangChao. ""); LCD_ write_ string(0,LINE2,"" Thank You! ""); delay_ nms(500); }}/********************************************************************//******************** LCD PART *************************************/void LCD_ delay(void) { unsigned char i; for(i=LCD_ DELAY_ TIME; i>ZERO; i--) // be sure lcd reset ;}/********************************************************************/ void LCD_ en_ command(unsigned char command){ LCDIO=command; LCD1602_ RS=LOW; LCD1602_ RW=LOW; LCD1602_ EN=LOW; LCD_ delay(); LCD1602_ EN=HIGH;}/********************************************************************/ void LCD_ en_ dat(unsigned char dat){ LCDIO=dat; LCD1602_ RS=HIGH; LCD1602_ RW=LOW; LCD1602_ EN=LOW; LCD_ delay(); LCD1602_ EN=HIGH;}/********************************************************************/ void LCD_ set_ xy( unsigned char x, unsigned char y ){ unsigned char address; if (y == LINE1) address = LINE1_ HEAD + x; else address = LINE2_ HEAD + x; LCD_ en_ command(address); }/********************************************************************/ void LCD_ write_ char( unsigned x,unsigned char y,unsigned char dat){ LCD_ set_ xy( x, y ); LCD_ en_ dat(dat);}/********************************************************************/ void LCD_ write_ string(unsigned char X,unsigned char Y,unsigned char *s){ LCD_ set_ xy( X, Y ); // set address while (*s) // write character { LCDIO=*s; LCD_ en_ dat(*s); s ++; }}/********************************************************************/ void LCD_ init(void){ CLEARSCREEN;// clear screen LCD_ en_ command(DATA_ MODE);// set 8 bit data transmission mode LCD_ en_ command(OPEN_ SCREEN);// open display (enable lcd display) LCD_ en_ command(DISPLAY_ ADDRESS);// set lcd first display address CLEARSCREEN;// clear screen}/********************************************************************//*********************** OTHER PART *********************************/void delay_ nms(unsigned int n) { unsigned int i=0,j=0; for (i=n; i>0; i--) for (j=0; j<1140; j++); }/********************************************************************/, Read the full text, technical section About ARM7 S3C4510B μ Clinux migration issues Design scheme of multi loop charge discharge controller Interrupt service routine jump of ARM embedded system Design of LED dimming engine based on 8-bit MCU How to display Chinese characters, ASCII characters and color graphics on LCD“

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us