- #include <STC32G.H>
-
- volatile unsigned char aiData[] = {0x1,0x3,0x7,0xF,0x1F,0x3F,0x7F,0xFF};
- volatile unsigned char iIndex;
- volatile unsigned char iIndexa;
- volatile unsigned char edata iByte;
- volatile unsigned char iBit;
- sbit iByte0 = iByte^0;
- sbit iByte1 = iByte^1;
- sbit iByte2 = iByte^2;
- sbit iByte3 = iByte^3;
- sbit iByte4 = iByte^4;
- sbit iByte5 = iByte^5;
- sbit iByte6 = iByte^6;
- sbit iByte7 = iByte^7;
-
- void main()
- {
- WTST = 0;
- EAXFR = 1;
- CKCON = 0;
-
- P0M1 = 0xF0;
- P0M0 = 0x00;
-
- EA = 0;
-
- iIndex = 0;
-
- while (1)
- {
- if (iIndex > 7)
- {
- iIndex = 0;
- P03 = 0;
- }
- P01 = 0;
- iIndexa = 7 - iIndex;
- iByte = aiData[iIndexa];
- P03=iByte0;
- P03=iByte1;
- P03=iByte2;
- P03=iByte3;
- P03=iByte4;
- P03=iByte5;
- P03=iByte6;
- P03=iByte7;
- P01 = 1;
- iIndex++;
-
- }
-
- }
复制代码
|