求基于8051单片机用C语言编写的双矩阵键盘扫描程序(5个IO口控制25个按 ...答:include<reg51.h> define rowkey() (~P2)&0x0f//键盘输入端 define OUT P0 //数码管显示输出端 unsigned char code TAB[]= { 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0x89,0xC7,0xC8,0xC1,0x8C,0xA3,0xBF,0xFF,0xFF ...
51单片机用四个按键同时控制数码管和步进电机,按键作为加减器,数码管...答:include "reg52.h"void delay(unsigned int t);//Motor sbit F1 = P1^0;sbit F2 = P1^1;sbit F3 = P1^2;sbit F4 = P1^3;unsigned char code FFW[8]={0xfe,0xfc,0xfd,0xf9,0xfb,0xf3,0xf7,0xf6}; //反转 unsigned char code FFZ[8]={0xf6,0xf7,0xf3,0xfb,0xf9,0xfd,...
51单片机怎么用一个按键控两个数码管,按一下改变两个数字的显示速度_百 ...答:include<reg51.h> define uchar unsigned char;uchar distab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00}; //0到f uchar number,dat,dattop=10,cnt=0;sbit keyu=P1^0;sbit keyd=P1^1;void t0isr() interrupt 1 { TH0...
单片机程序求修改,实现按键控制数码管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...