单片机源程序如下:
- #include <STC89C5xRC.h>
- #include <INTRINS.H>
- #define uchar unsigned char
- #define uint unsigned int
- #define DATA P0
- sbit LED=P2^0;
- sbit WEI1=P2^1;
- sbit WEI2=P2^2;
- sbit WEI3=P2^3;
- sbit WEI4=P2^4;
- void delay(uint count) //1MS
- {
- uint i,j,k;
- for(k=count;k>0;k--)
- for(i=2;i>0;i--)
- for(j=1200;j>0;j--);
- }
- unsigned char leddata[25]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,
- 0x88,0x83,0xC6,0xA1,0x86,0x8E,0x89,0xC7,0xC8,0xC1,0x8C,0xA3,0xBF,0X00,0xFF};
- void main(void)
- {
- uchar i;
- LED=0;
- WEI1=0;
- WEI2=0;
- WEI3=0;
- WEI4=0;
- while(1)
- {
- for(i=0;i<25;i++)
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
数码管测试程序12.rar
(22.27 KB, 下载次数: 26)
|