/********************************************* 简易旋转LED的制作 文章地址 http://www.66kv.cn/Article/ShowArticle.asp?ArticleID=75 **********************************************/ #include #define uchar unsigned char void delay(); uchar zimo[16]={0xff,0x7d,0x00,0x7d,0xff, //字母“I” 0xc7,0x83,0xc1,0x83,0xc7, //心形图案 0xff, //用来搁开心形图案和字母U 0x03,0xfd,0xfd,0xfd,0x03}; //字母“U” //0xc9,0xb6,0xb6,0xb6,0xc9}; void main() {TCON|=0x01; //外部中断0 下降沿触发 IE=0x81; //开中断 while(1); } void delay() //延时子程序,延时长短请根据的你的电机转速进行调整 {uchar j; for(j=0;j<255;j++) {;} } void display() interrupt 0 //中断处理 {uchar i; for(i=0;i<16;i++) {P1=zimo[i]; delay();} P1=0xff; }