![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
馨光灿烂
学习日记本
展开
-
51单片机按键控制数码管加减和秒表
#include<reg52.h>#define uchar unsigned char#define uint unsigned int sbit k1=P3^4;sbit k2=P3^5;sbit k3=P3^6;sbit k4=P3^7;sbit du=P2^6;sbit we=P2^7;uchar counter,num;uchar code table...原创 2018-12-23 15:59:09 · 16838 阅读 · 0 评论 -
一个按键控制LED亮灭!
#include<reg52.h>#define uchar unsigned char#define uint unsigned intsbit d1=P1^0;sbit key1=P3^4;void delay(uint z){uint x,y;for(x=z;x>0;x–)for(y=110;y>0;y–);}原创 2018-12-23 14:03:07 · 6982 阅读 · 0 评论 -
按键使蜂鸣器发出报警声
#include <reg52.h>#define uchar unsigned char#define uint unsigned intsbit SPK = P2^2;sbit K1 = P3^2;void Alarm(uchar t){ uchar i,j; for(i=0;i<200;i++) { SPK = ~SPK; for(j=0;j...原创 2018-12-30 22:11:06 · 7723 阅读 · 0 评论 -
按键控制电机控制窗帘
#include<reg52.h>#define uchar unsigned char#define uint unsigned intsbit in1=P0^0;sbit in2=P0^1;sbit in3=P0^2;sbit in4=P0^3;sbit key1=P3^4;sbit key2=P3^5;void delay(uint z) { ui...原创 2019-01-14 14:38:30 · 981 阅读 · 0 评论