⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_main.c

📁 lcd1602编程资料。包括8位和4位口的c语言程序。当单片机口不够时可用4位接法
💻 C
字号:
/******************************************************************************************
  This function is used for LCD1602: 8-bits tranfer mode. The following is an example to control it.
  DB0-7 connects to P0-7, and E connects to P2.0, RS connects to P2.1, R/W connects to P2.2
*******************************************************************************************/

#include <reg51.h>
#include <intrins.h>
#include <string.h>
#include "lcd1602.h"


//interrupt


void main(void)
{
  uchar Buff1[] = {0x2d, 0x2d, 0x4e, 0x69, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x21, 0x2d, 0x2d};
  uchar Buff2[] = {0x5a, 0x68, 0x61, 0x6e, 0x67, 0x20, 0x58, 0x69, 0x61, 0x6f, 0x63, 0x68, 0x65, 0x6e, 0x67};
  uchar Buff3[] = "Hi, mcu!";

//initialization
  ini_lcd1602();

//main
  wr_byte_ram   (1, 0x00, 'Z');
  wr_length_ram (1, 0x00, Buff1, 16);
  wr_length_ram (1, 0x40, Buff2, 15);
  wr_length_ram (1, 0x00, Buff3, strlen(Buff3));

  while(1);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -