这个程序不懂,#include #define uchar unsigned char#define uint unsigned intsbit BEEP = P3^7;uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00};uchar Pre_KeyNO = 16,KeyNO = 16;(这个不
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/20 21:21:18
![这个程序不懂,#include #define uchar unsigned char#define uint unsigned intsbit BEEP = P3^7;uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00};uchar Pre_KeyNO = 16,KeyNO = 16;(这个不](/uploads/image/z/13386630-30-0.jpg?t=%E8%BF%99%E4%B8%AA%E7%A8%8B%E5%BA%8F%E4%B8%8D%E6%87%82%2C%23include+%23define+uchar+unsigned+char%23define+uint+unsigned+intsbit+BEEP+%3D+P3%5E7%3Buchar+code+DSY_CODE%5B%5D%3D%7B0xc0%2C0xf9%2C0xa4%2C0xb0%2C0x99%2C0x92%2C0x82%2C0xf8%2C0x80%2C0x90%2C0x88%2C0x83%2C0xc6%2C0xa1%2C0x86%2C0x8e%2C0x00%7D%3Buchar+Pre_KeyNO+%3D+16%2CKeyNO+%3D+16%3B%EF%BC%88%E8%BF%99%E4%B8%AA%E4%B8%8D)
这个程序不懂,#include #define uchar unsigned char#define uint unsigned intsbit BEEP = P3^7;uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00};uchar Pre_KeyNO = 16,KeyNO = 16;(这个不
这个程序不懂,
#include
#define uchar unsigned char
#define uint unsigned int
sbit BEEP = P3^7;
uchar code DSY_CODE[]=
{
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00
};
uchar Pre_KeyNO = 16,KeyNO = 16;(这个不懂)
void DelayMS(uint ms)
{
uchar t;
while(ms--)
{
for(t=0;t> 4 ^ 0x0f;(这个不懂)
switch(Tmp)
{
case 1:KeyNO += 0; break;(为什么有+)
case 2:KeyNO += 4; break;
case 4:KeyNO += 8; break;
case 8:KeyNO += 12;
}
}
void Beep()
{
uchar i;
for(i=0;i
这个程序不懂,#include #define uchar unsigned char#define uint unsigned intsbit BEEP = P3^7;uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00};uchar Pre_KeyNO = 16,KeyNO = 16;(这个不
脱离了硬件不太好理解,不过大体应该是
0.0问题:还有P1口,P0口分别代表什么啊!
这是最基本的,可能那你不是搞硬件的,那是单片机的IO口
1uchar Pre_KeyNO = 16,KeyNO = 16;(这个不懂)
这两个应该是来实现一个消抖的功能
2Tmp = P1 ^ 0x0f;(是检测地位有没有1吗)
逻辑与取低四位
3case 1:KeyNO += 0; break;(为什么有+)
和后面的一起表示那个按下的意思,不能单独理解
4P0 = 0x00;(这个不懂)
置零,和内部有关
5if(Pre_KeyNO != KeyNO)(不懂
消抖
6P0 = DSY_CODE[KeyNO];(不懂
表示有按键按下
7P0 = DSY_CODE[KeyNO];(不懂)
表示有按键按下
8Pre_KeyNO = KeyNO;(Pre_KeyNO,KeyNO分别是什么意思啊)
消抖的辅助工具
9 ok