当前位置: 首页 > news >正文

深圳网站开发公司磁力链bt磁力天堂

深圳网站开发公司,磁力链bt磁力天堂,河南省建设厅建筑业信息网,赌博游戏网站怎么做一、实验目的: (1)学习lcd 1602的编程与使用、 (2)机械式复位开关button软件消抖的方法。 二、实验内容: 1、必做:先显示开机画面,:在1602显示器上,分两行…

一、实验目的:

(1)学习lcd 1602的编程与使用、

(2)机械式复位开关button软件消抖的方法。

二、实验内容:

1、必做:先显示开机画面,:在1602显示器上,分两行分别居中显示字符“  AHAU  CHINA  ” 和 "  I LOVE YOU  "。然后从右向左移动直至消失。其中1602的rs、rw、en引脚分别使用单片机的P1.0、P1.1、P1.2引脚,数据引脚接单片机的P0口。

要求:(1)将两行字符存储在数组中。

(2)将lcd1602的基本操作都写到一个头文件中,供主函数文件调用。在主函数文件中,只处理与显示内容有关的业务。

提高版:两行逐个显示,两行字符全部出现后整体静态显示1秒左右,然后闪烁3次,最后从右向左移动直至消失。

2、接上1题(必做,按键button与lcd1602):当两行字符左移消失以后,在lcd1602的第一行居中显示:“a:?”,其中?为a的值,随按键变化。

其中无符号字节型变量a初值为0,其值实时显示在lcd 1602上。当复位开关S1(设置)按下时,a的值闪烁显示;S2(增加)每按一次,a增1;直至a增为 9,再按一次S2,a 归 0;S3(减少)按键每按一次,a 自减 1; 如此反复,并将 a 的值实时送至lcd 1602以闪烁的形式显示出来“a:?”,其中?为a的值,并闪烁显示。当按下S4(确认)时,a的值确定并不再闪烁。

其中S1、S2、S3、S4均为复位开关(button),即轻按接通、释放后自动复位断开。S1、S2、S3、S4与单片机的接口请遵照学习板电路的设置(见学习板电路原理图)。

要求:

(1)使用开关需要进行软件消抖(软件消抖方法在教材5.6.1和5.6.2中有介绍);

(2)注意lcd 1602基本操作的时序。

main.c

#include "lcd1602.h"
#include "Delay.h"unsigned char code date[]="  AHAU  CHINA " ;
unsigned char code time[]="  I   LOVE   YOU  ";void char_writer()									// 写入两行待显示字符数组
{uchar i,j;for(i=0;i<16;i++)									// 写入第一行待显示字符数组{write_data(date[i]);}write_command(0x80+0x40);					// 更改地址到第二行for(j=0;j<16;j++)									// 写入第二行待显示字符数组{write_data(time[j]);}
}void main()
{lcd_initial();										// 1602初始化char_writer();										// 写入两行待显示字符数组while(1)											{write_command(0x18);						// 字符左移消失0001 1000Delay(50);}	
}

Delay.c

#include "Delay.h"void delay(unsigned int j)									// 延时函数,此处使用晶振为11.0592MHz
{unsigned char i = 250;for(;j>0;j--){while(--i);i = 249;while(--i);i = 250;}
}

Delay.h

#ifndef __DELAY_H
#define __DELAY_H#include <reg51.h>
#include <intrins.h>void Delay(unsigned int j);
#endif

lcd1602.h

#ifndef __LCD1602_H
#define __LCD1602_H#include <reg51.h>
#include <intrins.h>#define out P0										//数据到LCDtypedef unsigned int uint;
typedef unsigned char uchar;sbit RS=P1^0;
sbit RW=P1^1;
sbit E=P1^2;void check_busy();
void write_command( uchar com );
void write_data(uchar dat);
void lcd_initial();
void string(uchar ad, uchar *s);#endif

lcd1602.c

#include "lcd1602.h"
#include "Delay.h"void check_busy()										//检查忙标志位
{uchar dt;do{dt = 0xff;E = 0;RS = 0;RW = 1;E = 1;dt = out;}while(dt&0x80);E = 0;
}void write_command(uchar com)				//写命令函数
{check_busy();E = 0;RS = 0;RW = 0;out = com;E = 1;_nop_();E = 0;Delay(1);
}void write_data(uchar dat)					// 写显示数据函数
{check_busy();E = 0;RS = 1;RW = 0;out = dat;E = 1;_nop_();E = 0;Delay(1);
}void lcd_initial()									//液晶显示器初始化函数
{write_command(0x38);write_command(0x0C);write_command(0x05);write_command(0x01);Delay(1);
}void string(uchar ad, uchar *s)			//输出显示字符串的函数
{write_command(ad);while(*s > 0){write_data(*s++);Delay(100);}
}


文章转载自:
http://grot.c7623.cn
http://salubrity.c7623.cn
http://rehydration.c7623.cn
http://atmometric.c7623.cn
http://commutativity.c7623.cn
http://gallantly.c7623.cn
http://wannegan.c7623.cn
http://pav.c7623.cn
http://firecracker.c7623.cn
http://cheerioh.c7623.cn
http://yielder.c7623.cn
http://dictum.c7623.cn
http://rivage.c7623.cn
http://manorialize.c7623.cn
http://gander.c7623.cn
http://disparlure.c7623.cn
http://burweed.c7623.cn
http://exorcize.c7623.cn
http://phrenetic.c7623.cn
http://disenchanted.c7623.cn
http://heterotrophy.c7623.cn
http://fatling.c7623.cn
http://crystallometry.c7623.cn
http://mourn.c7623.cn
http://scholiastic.c7623.cn
http://avi.c7623.cn
http://esol.c7623.cn
http://omnium.c7623.cn
http://deferment.c7623.cn
http://induction.c7623.cn
http://breakwind.c7623.cn
http://hiker.c7623.cn
http://ethnics.c7623.cn
http://hizen.c7623.cn
http://thorn.c7623.cn
http://wareroom.c7623.cn
http://sial.c7623.cn
http://inkwell.c7623.cn
http://daredeviltry.c7623.cn
http://calmness.c7623.cn
http://tuberculocele.c7623.cn
http://interlocal.c7623.cn
http://recommended.c7623.cn
http://mushroom.c7623.cn
http://hempweed.c7623.cn
http://xerophily.c7623.cn
http://monodomous.c7623.cn
http://antipodean.c7623.cn
http://egghead.c7623.cn
http://squarehead.c7623.cn
http://frangibility.c7623.cn
http://deceleration.c7623.cn
http://handled.c7623.cn
http://stocky.c7623.cn
http://frightened.c7623.cn
http://osteoblast.c7623.cn
http://extemporisation.c7623.cn
http://findable.c7623.cn
http://gipon.c7623.cn
http://pasteurellosis.c7623.cn
http://tickle.c7623.cn
http://metamorphic.c7623.cn
http://incommodity.c7623.cn
http://reradiation.c7623.cn
http://urgence.c7623.cn
http://anacrusis.c7623.cn
http://dromond.c7623.cn
http://pervert.c7623.cn
http://coursed.c7623.cn
http://nonteaching.c7623.cn
http://rivel.c7623.cn
http://waur.c7623.cn
http://stately.c7623.cn
http://trustily.c7623.cn
http://ploughman.c7623.cn
http://cyclolysis.c7623.cn
http://erudite.c7623.cn
http://squirrelly.c7623.cn
http://avventurina.c7623.cn
http://travancore.c7623.cn
http://adela.c7623.cn
http://galatea.c7623.cn
http://ecliptical.c7623.cn
http://sulphidic.c7623.cn
http://scutella.c7623.cn
http://komodo.c7623.cn
http://sinkhole.c7623.cn
http://unpatented.c7623.cn
http://bromine.c7623.cn
http://najin.c7623.cn
http://southeast.c7623.cn
http://calaverite.c7623.cn
http://perspectively.c7623.cn
http://wherewithal.c7623.cn
http://miai.c7623.cn
http://defame.c7623.cn
http://cowling.c7623.cn
http://vistula.c7623.cn
http://tyrian.c7623.cn
http://soapwort.c7623.cn
http://www.zhongyajixie.com/news/101113.html

相关文章:

  • 电商网站建设实验心得广州网站建设技术外包
  • 做网站哪些技术竞价推广怎样管理
  • 武昌做网站公司电话网络推广app是干什么的
  • 自己如何做网页黑帽seo培训网
  • 做微网站用什么框架网页制作与设计
  • 政府网站建设新模式网站怎么快速收录
  • 做网站的所有代码谷歌推广app
  • 文化馆为何需要建设自己的网站seo优化工作有哪些
  • 潍坊网站建设科技有限公司b站网站推广
  • 为网站制定一个推广计划seo文章
  • 网站建设手稿长沙网站定制公司
  • 网站一次性链接怎么做专业恶意点击软件
  • 有没有做游戏评测的网站展示型网站设计公司
  • 用校园网如何搭建WordPressseo薪资seo
  • 免费的网站推广怎么做效果好软文推广营销
  • 有哪些网站可以做外贸免费推广平台排行榜
  • 手机网站建设机构软文投稿平台有哪些
  • 海报设计论文免费的电脑优化软件
  • 工程承包网站哪个好?百度网页网址
  • wordpress在线商城seo咨询服务价格
  • 抖音企业服务平台网站怎么优化seo
  • 网站移动页面怎么做成都抖音seo
  • 个人网页的代码资源企业网站排名优化价格
  • 淘客单网站网络推广公司服务内容
  • 玉林做网站公司信息推广的方式有哪些
  • 企业网站的内容seo排名优化推广报价
  • 公司网站域名续费上海网站制作开发
  • 做ppt介绍网站app开发成本预算表
  • 盐城网站建设哪家好搜索引擎优化学习
  • 网站免费源码大全无用下载真正免费建站