/* Main.c file generated by New Project wizard
*
* Created: 周四 十月 19 2017
* Processor: 80C52
* Compiler: Keil for 8051
*/
#include <reg51.h>
#include <stdio.h>
unsigned char code yin[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void delay(unsigned int x){
int d,c;
for(c=0;c<x;c++){
for(d=0;d<110;d++){
;
}
}
}
void main(void)
{
// Write your code here
while (1){
int a;
unsigned char b;
b=0x0f;
for(a=1;a<5;a++){
b<<=1;
if(a>=2){
b=b+1;
}
P0=yin[a];
P2=yin[a];
P1=b;
delay(15);
}
}
}
此帖出自
小平头技术问答
一周热门 更多>