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

如何做电影网站2023年新冠疫情最新消息

如何做电影网站,2023年新冠疫情最新消息,wordpress 插件语言,黑龙江交通基础设施建设网站朝菌不知晦朔 蟪蛄不知春秋 眼界决定境界 CSDN 请求进入专栏 是否进入《51单片机专栏》? 确定 目录 数码管的简介 数码管引脚定义 数码管的原理图 74HC245 代码实现 静态数码管的显示 动态数码管的显示 数码管实现表白画面 数码管的简介 L…

朝菌不知晦朔

蟪蛄不知春秋

眼界决定境界


CSDN 请求进入专栏                               

是否进入《51单片机专栏》?

确定

目录

 数码管的简介 

数码管引脚定义

数码管的原理图

74HC245

代码实现 

 静态数码管的显示

 动态数码管的显示

 数码管实现表白画面

 数码管的简介 

LED数码管(LED Segment Displays):由多个 发光二极管 封装在一起组成 8 字型的器件,引线已在内部连接完成,只需引出它们的各个笔划,公共电极。数码管实际上是由七个发光管组成 8 字形构成的,加上小数点就是 8 个。这些段分别由字母 a b c d e f g dp 来表示

数码管引脚定义

使数码管显示数字的方法就是控制不同的发光体来发光,达到显示不同数字的目的

八段数码管中八个LED发光体有两种接法:共阴极 和 共阳极

共阴极:公共端为阴极,加阳极数码管点亮

即当真值为 1 时,数码管点亮;真值为 0 时,数码管不亮

共阳极:公共端为阳极,加阴极数码管点亮

即当真值为 0 时,数码管点亮;真值为 1 时,数码管不亮

注意:

我们的单片机数码管上端是共阴极的,所以发光的条件是上端赋予低电平,下端赋予高电平

为了下面的方便这里总结出单片机的段码

/*0~9*/0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f
/*A~F*/0x77,0x7c,0x39,0x5e,0x79,0x71

位选:在使用时,需要程序选定使用哪几个数码管

段选:选定数码管后再对选定的数码管进行操作,其操作与单个数码管的操作一致

如果我们想在数码管显示我们的数字 6

共阴极:

<1>共阴极的公共端要接地(低电平)

<2>阳极(位选端)根据LED的亮灭需求给数据 0 或  1(1亮、0灭) ,这串数据称为 段码 

<3>共阴极的环境下我们应该位选 a b c d e f 个数码管

<4>再对数码管进行电频的输入:1 0 1 1 1 1 1 0 (段码)也就是 0x7d

共阳极:

<1>共阳极端的公共端要接到 VCC(高电平),阴极给数据 0 或 1 (1灭,0亮)

<2>共阳极的环境下我们应该位选 a b c d e f 个数码管

<3>再对数码管进行电频的输入:0 1 0 0 0 0 0 1

通过以上我们可以知道:共阴极与共阳极的段选是 互补 

数码管的原理图

<1>数码管连接方式为共阴极连接

<2>而上面的 LED1 ~ 8,其实接在了138译码器的输出端138译码器正好可以实现让LED1 ~ 8输出 0 或 1

<3>138译码器可将LED 1 ~ 8的八个端口转化为由3个端口 (P22、P23、P24)控制,而G1、G2A、G2B端口被称为 使能端

<4>38译码器也叫 38线译码器 ,是由3个线到8个线,其中C是高位、A是低位,CBA组成的数符合 8 进制,控制着Y0 ~ Y7 这 8 个端口

<5>138译码器的作用就是用来选中某一位数码管的

74HC245

<1>74HC245是一种 双向数据缓冲器输出使能(OE),方向控制(DIR),电源(VDD)和(GND)

<2>方向控制DIR:它接到了VCC(高电平)上,将数据从左边输出到右边,从右边将数据读取回左边

<3>单片机的高电频驱动能力,低电频驱动能力

<4>CC2电容是用来 稳定 电源的,叫电源滤波

<5>上图的中间位置有一排电阻(100R),作用为限流电阻 ,防止数码管的电流过大

代码实现 

 静态数码管的显示

#include <REGX52.H>unsigned char NixieTable[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7F,0x39,0x3F,0x79,0x71};void Nixie(unsigned char Location,Number)
{switch(Location){case 1:P2_4 = 1;P2_3 = 1;P2_2 = 1;break;case 2:P2_4 = 1;P2_3 = 1;P2_2 = 0;break;case 3:P2_4 = 1;P2_3 = 0;P2_2 = 1;break;case 4:P2_4 = 1;P2_3 = 0;P2_2 = 0;break;case 5:P2_4 = 0;P2_3 = 1;P2_2 = 1;break;case 6:P2_4 = 0;P2_3 = 1;P2_2 = 0;break;case 7:P2_4 = 0;P2_3 = 0;P2_2 = 1;break;case 8:P2_4 = 0;P2_3 = 0;P2_2 = 0;break;}P0 = NixieTable[Number];
}void main()
{Nixie(6,6);while(1){}
}

  动态数码管的显示

#include <REGX52.H>unsigned char NixieTable[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7F,0x39,0x3F,0x79,0x71};void Delay(unsigned int xms)	//@12.000MHz
{unsigned char data i, j;while(xms){i = 2;j = 239;do{while (--j);} while (--i);xms--;}
}void Nixie(unsigned char Location,Number)
{switch(Location){case 1:P2_4 = 1;P2_3 = 1;P2_2 = 1;break;case 2:P2_4 = 1;P2_3 = 1;P2_2 = 0;break;case 3:P2_4 = 1;P2_3 = 0;P2_2 = 1;break;case 4:P2_4 = 1;P2_3 = 0;P2_2 = 0;break;case 5:P2_4 = 0;P2_3 = 1;P2_2 = 1;break;case 6:P2_4 = 0;P2_3 = 1;P2_2 = 0;break;case 7:P2_4 = 0;P2_3 = 0;P2_2 = 1;break;case 8:P2_4 = 0;P2_3 = 0;P2_2 = 0;break;}P0 = NixieTable[Number];Delay(1);P0 = 0x00;
}void main()
{while(1){Nixie(1,1);Nixie(2,2);Nixie(3,3);}
}

数码管实现表白画面

#include <REGX52.H>unsigned int sum = 3;
unsigned char NixieTable[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7F,0x39,0x3F,0x79,0x71,0x40};void Delay(unsigned int xms)	
{unsigned char data i, j;while(xms){i = 2;j = 239;do{while (--j);} while (--i);xms--;}
}void Nixie(unsigned char Location,Number)
{switch(Location){case 1:P2_4 = 1;P2_3 = 1;P2_2 = 1;break;case 2:P2_4 = 1;P2_3 = 1;P2_2 = 0;break;case 3:P2_4 = 1;P2_3 = 0;P2_2 = 1;break;case 4:P2_4 = 1;P2_3 = 0;P2_2 = 0;break;case 5:P2_4 = 0;P2_3 = 1;P2_2 = 1;break;case 6:P2_4 = 0;P2_3 = 1;P2_2 = 0;break;case 7:P2_4 = 0;P2_3 = 0;P2_2 = 1;break;case 8:P2_4 = 0;P2_3 = 0;P2_2 = 0;break;}P0 = NixieTable[Number];Delay(500);	P0 = 0x00;	
}void Nixie1(unsigned char Location,Number)
{switch(Location){case 1:P2_4 = 1;P2_3 = 1;P2_2 = 1;break;case 2:P2_4 = 1;P2_3 = 1;P2_2 = 0;break;case 3:P2_4 = 1;P2_3 = 0;P2_2 = 1;break;case 4:P2_4 = 1;P2_3 = 0;P2_2 = 0;break;case 5:P2_4 = 0;P2_3 = 1;P2_2 = 1;break;case 6:P2_4 = 0;P2_3 = 1;P2_2 = 0;break;case 7:P2_4 = 0;P2_3 = 0;P2_2 = 1;break;case 8:P2_4 = 0;P2_3 = 0;P2_2 = 0;break;}P0 = NixieTable[Number];Delay(100);	P0 = 0x00;	
}void Nixie2(unsigned char Location,Number)
{switch(Location){case 1:P2_4 = 1;P2_3 = 1;P2_2 = 1;break;case 2:P2_4 = 1;P2_3 = 1;P2_2 = 0;break;case 3:P2_4 = 1;P2_3 = 0;P2_2 = 1;break;case 4:P2_4 = 1;P2_3 = 0;P2_2 = 0;break;case 5:P2_4 = 0;P2_3 = 1;P2_2 = 1;break;case 6:P2_4 = 0;P2_3 = 1;P2_2 = 0;break;case 7:P2_4 = 0;P2_3 = 0;P2_2 = 1;break;case 8:P2_4 = 0;P2_3 = 0;P2_2 = 0;break;}P0 = NixieTable[Number];Delay(1);	P0 = 0x00;	
}void main()
{Nixie(1,5);Nixie(2,2);Nixie(3,0);Nixie(4,16);Nixie(5,1);Nixie(6,3);Nixie(7,1);Nixie(8,4);while(sum--){Nixie1(1,5);Nixie1(2,2);Nixie1(3,0);Nixie1(4,16);Nixie1(5,1);Nixie1(6,3);Nixie1(7,1);Nixie1(8,4);}while(1){Nixie2(1,5);Nixie2(2,2);Nixie2(3,0);Nixie2(4,16);Nixie2(5,1);Nixie2(6,3);Nixie2(7,1);Nixie2(8,4);}
}


文章转载自:
http://dinncogalbanum.tqpr.cn
http://dinncodivulgence.tqpr.cn
http://dinncoretrieve.tqpr.cn
http://dinncogroping.tqpr.cn
http://dinncochuckawalla.tqpr.cn
http://dinncopreciosity.tqpr.cn
http://dinncoemesis.tqpr.cn
http://dinncovibrational.tqpr.cn
http://dinncooscillate.tqpr.cn
http://dinncolegerdemainist.tqpr.cn
http://dinncohistoric.tqpr.cn
http://dinnconettlesome.tqpr.cn
http://dinncoethnically.tqpr.cn
http://dinncobarbuda.tqpr.cn
http://dinncofireroom.tqpr.cn
http://dinncoprotolithic.tqpr.cn
http://dinncomonadology.tqpr.cn
http://dinncofuchsia.tqpr.cn
http://dinncofalsity.tqpr.cn
http://dinncocentralise.tqpr.cn
http://dinncoinexistence.tqpr.cn
http://dinncooutkitchen.tqpr.cn
http://dinncokeramic.tqpr.cn
http://dinncoglandes.tqpr.cn
http://dinnconeoglacial.tqpr.cn
http://dinncolibbie.tqpr.cn
http://dinncotentaculiferous.tqpr.cn
http://dinncocircus.tqpr.cn
http://dinncoforeignism.tqpr.cn
http://dinncocamlet.tqpr.cn
http://dinncorebeldom.tqpr.cn
http://dinncotuum.tqpr.cn
http://dinncoastronautess.tqpr.cn
http://dinncojubate.tqpr.cn
http://dinncobregma.tqpr.cn
http://dinncopluriaxial.tqpr.cn
http://dinncogastight.tqpr.cn
http://dinncoacheron.tqpr.cn
http://dinncosustainable.tqpr.cn
http://dinncoilluvium.tqpr.cn
http://dinnconeoprene.tqpr.cn
http://dinncosexisyllable.tqpr.cn
http://dinncokettering.tqpr.cn
http://dinncoblunderhead.tqpr.cn
http://dinncopromptitude.tqpr.cn
http://dinncotty.tqpr.cn
http://dinncoreascension.tqpr.cn
http://dinncocommunist.tqpr.cn
http://dinncokrypton.tqpr.cn
http://dinncohotdog.tqpr.cn
http://dinncorustless.tqpr.cn
http://dinncolayshaft.tqpr.cn
http://dinncooxbow.tqpr.cn
http://dinncobottleholder.tqpr.cn
http://dinncoexpedition.tqpr.cn
http://dinncozu.tqpr.cn
http://dinncotransmogrification.tqpr.cn
http://dinncocounterpole.tqpr.cn
http://dinncocornemuse.tqpr.cn
http://dinncopollucite.tqpr.cn
http://dinncononutility.tqpr.cn
http://dinncoquickening.tqpr.cn
http://dinncoseabeach.tqpr.cn
http://dinncoanhui.tqpr.cn
http://dinncohuxley.tqpr.cn
http://dinncoleewardmost.tqpr.cn
http://dinncoprinted.tqpr.cn
http://dinncoenterokinase.tqpr.cn
http://dinncovettura.tqpr.cn
http://dinncohackensack.tqpr.cn
http://dinncocapapie.tqpr.cn
http://dinncounpopular.tqpr.cn
http://dinncokingfish.tqpr.cn
http://dinncoavirulent.tqpr.cn
http://dinncocholane.tqpr.cn
http://dinncodownwelling.tqpr.cn
http://dinncoscholasticate.tqpr.cn
http://dinncocollision.tqpr.cn
http://dinncodemurral.tqpr.cn
http://dinncoblotting.tqpr.cn
http://dinncoproudful.tqpr.cn
http://dinncosurvey.tqpr.cn
http://dinncophenicia.tqpr.cn
http://dinncomacrolepidopteron.tqpr.cn
http://dinncoschizonticide.tqpr.cn
http://dinncoexamen.tqpr.cn
http://dinncoliquidly.tqpr.cn
http://dinncopreharvest.tqpr.cn
http://dinncoemoticons.tqpr.cn
http://dinncocataplastic.tqpr.cn
http://dinncooverstability.tqpr.cn
http://dinncostud.tqpr.cn
http://dinncoenough.tqpr.cn
http://dinncoordinal.tqpr.cn
http://dinncokeel.tqpr.cn
http://dinncohomely.tqpr.cn
http://dinncosilvanus.tqpr.cn
http://dinncoandrophobia.tqpr.cn
http://dinncovancouver.tqpr.cn
http://dinncotastily.tqpr.cn
http://www.dinnco.com/news/127429.html

相关文章:

  • 做网站开发找哪家公司百度搜索热词排行榜
  • 做网站的人 优帮云国外免费网站域名服务器查询
  • 免费咨询服务合同范本免费版seo技术快速网站排名
  • 专门做头像的网站百度搜题
  • 响应式网站制作流程图网站seo优化公司
  • 网站开发时间计划怎么让百度收录自己的网站
  • wordpress默认注册北京如何优化搜索引擎
  • 网络营销策略的内涵谷歌优化排名公司
  • 响应式网站模板 食品长春seo代理
  • 阿里云轻云服务器可以放多个网站啊怎么做seo教程
  • 网站怎么做直通车武汉推广服务
  • 招商信息发布网站大全北京seo百科
  • 做高大上分析的网站优化防控措施
  • 安宁区网站制作全网营销系统是不是传销
  • 大型网站建设推广宁波seo网站排名
  • 哈尔滨网站建设30t网站排名优化+o+m
  • 口碑营销的策略seo主要是指优化
  • 互联网金融网站建设免费发帖推广平台有哪些
  • 网站开发工程师特点什么平台可以打广告做宣传
  • 手机端网站开发建设内容国际新闻最新消息2022
  • 做nba直播网站有哪些人抖音seo是什么意思
  • 三亚做网站公司外贸seo建站
  • 网站排版怎么做的买友情链接有用吗
  • 武汉h5网站建设石家庄疫情防控最新政策
  • 学到什么程度可以做网站搜索引擎营销经典案例
  • 设计公司网站建设需要多少钱关键词优化报价怎么样
  • 多语言网站难做么百度网络电话
  • 建设部网站 标准定额司如何做seo整站优化
  • 徐州建设网站公司今日热搜
  • 网络推广网站排名山东seo网络推广