段位亮灭是拼音
- #define liang 1 //共阳
- #define mie 0 //共阳
-
- //#define liang 0 //共阴
- //#define mie 1 //共阴
-
- void wei(unsigned char a)
- {
- P10=mie;
- P12=mie;
- P13=mie;
- P14=mie;
- P34=mie;
- P35=mie;
- P36=mie;
- P37=mie;
- switch(a)
- {
- case 0:
- P10=liang;
- break;
- case 1:
- P12=liang;
- break;
- case 2:
- P13=liang;
- break;
- case 3:
- P14=liang;
- break;
- case 4:
- P34=liang;
- break;
- case 5:
- P35=liang;
- break;
- case 6:
- P36=liang;
- break;
- case 7:
- P37=liang;
- break;
- default:
- break;
- }
- }
-
- void duan(unsigned char b)
- {
- P00=(bit)b&0x01;
- P01=(bit)b&0x02;
- P02=(bit)b&0x04;
- P03=(bit)b&0x08;
- P20=(bit)b&0x10;
- P21=(bit)b&0x20;
- P22=(bit)b&0x40;
- P23=(bit)b&0x80;
- }
复制代码
|