摘要:
前面学习了数码管和按键,将两者结合,完成一个用两个按键控制加减数字的小程序,一个按键控制加1另一个控制减1。#include sbit KeyAdd = P0^0; //加1按键sbit KeyDec = P0^1; //减1按键sbit LATCH1 = P2^2; //段锁存sbit LATCH2 = P2^3; //位锁存unsigned char code DuanMa[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};// 显示段码值0~9unsigned char code WeiMa[]={0xfe,0xfd,0xfb 阅读全文