51单片机按键控制

基于C语言对51单片机的控制,涉及按键控制数码管,小灯,点阵。

#include<reg52.h>
sbit ADDR0 = P1^0;
sbit ADDR1 = P1^1;
sbit ADDR2 = P1^2;
sbit ADDR3 = P1^3;
sbit ENLED = P1^4;
sbit KEY1 = P2^4;
unsigned char code LedChar[] = {
	0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,
	0x80, 0x90, 0xBF,  
};
unsigned char LedBuff[6] = {
	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};

unsigned char code image[] = {
	0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
	0x85,0xB5,0xB5,0xB5,0xB5,0xB5,0x85,0xFF,
	0xC3,0xDB,0xDB,0xC3,0xDF,0xDF,0xC3,0xFF,
	0xC3,0xDB,0xDB,0xC3,0xDB,0xDB,0xC3,0xFF,
	0xC3,0xDF,0xDF,0xDF,0xDF,0xDF,0xDF,0xFF,
	0xC3,0xFB,0xFB,0xC3,0xDB,0xDB,0xC3,0xFF,
	0xC3,0xFB,0xFB,0xC3,0xDF,0xDF,0xC3,0xFF,
	0xEF,0xE7,0xEB,0x81,0xEF,0xEF,0xEF,0xFF,
	0xC3,0xDF,0xDF,0xC3,0xDF,0xDF,0xC3,0xFF,
	0xC3,0xDF,0xDF,0xC3,0xFB,0xFB,0xC3,0xFF,
	0xE7,0xE3,0xE1,0xE7,0xE7,0xE7,0xC3,0x81,
	0xC3,0xDB,0xDB,0xDB,0xDB,0xDB,0xC3,0xFF
};

unsigned char fla
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

或许下个轮回

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值