文章分类 -  单片机

摘要:一.中断的基本概念 二.51单片机各引脚功能回顾 三.51的中断系统有5个中断源,2个优先级 四.51子系列允许5个中断源 五.外部中断源 与 触发方式 六.中断程序 七.中断优先级 八.例子程序 阅读全文
posted @ 2018-01-19 14:49 Justice-V 阅读(131) 评论(0) 推荐(0)
摘要:一.设初始值【P3=0xf0】,当S11被按压的时候,P3值变为【0xd0】 二.当S11被按下的值存储为L=0xd0(确定一列) 阅读全文
posted @ 2018-01-17 11:57 Justice-V 阅读(391) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-01-02 18:58 Justice-V 阅读(64) 评论(0) 推荐(0)
摘要:独立按键控制流水灯和数码管 阅读全文
posted @ 2018-01-02 13:27 Justice-V 阅读(1054) 评论(0) 推荐(0)
摘要:#include sbit led1=P1^3; sbit du=P2^6; sbit we=P2^7; void delay(unsigned int x) { unsigned char i; while(x--) { for(i=0;i<120;i++); } } unsigned char leddata[]={ 0x3F, //"0" 0x06, //"1" 0x5B, //"2" ... 阅读全文
posted @ 2018-01-01 16:13 Justice-V 阅读(156) 评论(0) 推荐(0)
摘要:在线钢琴:http://www.qupu123.com/Tools-virtualpiano.html 阅读全文
posted @ 2018-01-01 12:37 Justice-V 阅读(60) 评论(0) 推荐(0)
摘要:16位寄存器=1111111111111111(2进制)=十进制(65535) 总结 工作模式1: 程序,20秒计时器,点亮一个灯 阅读全文
posted @ 2017-12-31 18:23 Justice-V 阅读(483) 评论(0) 推荐(0)
摘要:位选,就是选择你想要点亮哪个数码管;段选,就是选择你想要点亮哪个数码管的哪个一段。 #include<reg52.h>#include "bstv51.h" sbit Duan=P2^6; //数码管段选sbit Wei=P2^7; //数码管位选 void main(){ P0=0x7c; Dua 阅读全文
posted @ 2017-12-30 19:55 Justice-V 阅读(162) 评论(0) 推荐(0)
摘要:三极管结构图 蜂鸣器 #include <reg52.h>sbit led=P1^0;sbit key=P3^0;sbit key2=P3^1;sbit key3=P3^2;sbit buzzer=P2^3; void delay(unsigned int x){ unsigned char i; 阅读全文
posted @ 2017-12-29 21:05 Justice-V 阅读(816) 评论(0) 推荐(0)
摘要:#include<reg52.h>sbit led=P1^2; //定义端口为P1.2void delay(unsigned int x) //延时函数,x为传递参数{ unsigned char i; while(x--) { for(i=0;i<120;i++); }} void main(vo 阅读全文
posted @ 2017-12-29 18:54 Justice-V 阅读(1935) 评论(0) 推荐(0)
摘要:#include<reg52.h> sbit led=P1^0; //定义端口P1.0 void main(void) { led=0; while(1);//让程序停留 } 具体的步骤 1.打开软件 2. 阅读全文
posted @ 2017-12-29 18:06 Justice-V 阅读(215) 评论(0) 推荐(0)
摘要:#include<reg52.h> sbit du=P2^0; //定义一个端口 sbit we=P2^1; 阅读全文
posted @ 2017-12-29 16:50 Justice-V 阅读(81) 评论(0) 推荐(0)