单片机程序求修改,实现按键控制数码管0-9,急!!!答:include <reg51.h> unsigned int num,a;sbit key0=P1^0;sbit key1=P1^1;sbit key2=P1^2;sbit key3=P1^3;bit flag;unsigned char code led_code[20] = { 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xd8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};void delay(unsigned char...
用C编写一个51单片机程序,P2.2接一个独立按键,在1位数码管上显示按键按...答:include<reg51.h> void Js_Scan(void);void delay(int x);sbit key=P2^2;int code LED_Num[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; //数码管扫描数组,共阴极 //int code LED_Num[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; //...