?? 花樣3.c
字號:
#include <reg52.h>
void main(void){//定義花樣
const unsigned char designb[10]={0x28,0xEB,0x32,0xA2,0xE1,0xA4,0x24,0xEA,0x20,0xA0};//0~9
unsigned int a; //定義循環(huán)用的變量
unsigned char b,count0,count1,count2,count3,temp; //在C51 編程中因內(nèi)存有限盡可能注意變量類型的使用
//盡可能使用少字節(jié)的類型,在大型的程序中很受用
while(1){
for(temp=0;temp<10;temp++){
P0 = designb[count0];//讀已定義的花樣數(shù)據(jù)并寫花樣數(shù)據(jù)到P0口,
P2 = 0XEF;
for (a=1; a<30000; a++);
P0 = designb[count1];//讀已定義的花樣數(shù)據(jù)并寫花樣數(shù)據(jù)到P0口,
P2 = 0XDF;
for (a=1; a<30000; a++);
P0 = designb[count2];//讀已定義的花樣數(shù)據(jù)并寫花樣數(shù)據(jù)到P0口,
P2 = 0XBF;
for (a=1; a<30000; a++);
P0 = designb[count3];//讀已定義的花樣數(shù)據(jù)并寫花樣數(shù)據(jù)到P0口,
P2 = 0X7F;
for (a=1; a<30000; a++);
}
count3++;
if(count3>9){
count2++;
count3=0;
}
if(count2>9){
count1++;
count2;
}
if(count1>9){
count0++;
count1=0;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -