提到摇摇棒,我们应该不生疏,但这款摇摇棒,用了一片20脚的STC11F04单片机,操控32只发光二极管,能显现13组左右的字或许图片,能显现高32宽64的图画和字体恣意,开机后主动切换每一组字,按了一下背部的开关后变成手动切换!能依据自己的喜爱用字模软件编写各式各样的字体和图片,办法很简单!只需有单片机的一点根底就能够随意的游玩,送给朋友和喜爱的人是件不错的礼物哦!此摇摇棒其实是没约束的,能够显现高32宽很长的字和图片,只不过费事的是要手晃得大一点罢了!所以一般都约束在适宜的规模!材料来源于网络,作者:张国荣。
#include
/*********外部接口界说**********/
#define uchar unsigned char
#define uint unsigned int //宏界说
#define out P1 //数据输出端口
sbit led1=P3^0; //第1组LED
sbit led2=P3^1; //第2组LED
sbit led3=P3^3; //第3组LED
sbit led4=P3^4; //第4组LED
sbit key1=P3^5; //按键输入
sbit p3_2=P3^2;
uchar KY; //KY效果在后面阐明
uchar BUFF; //缓存
/*********全局变量界说**********/
unsigned long int TimeCount=0;
unsigned int DelayN=80, //延时暂时计数
DelayTime=80; //每次延时的周期个数
unsigned char key;
/**********************************************/
void delay(unsigned char n);
void DelayMs(void);
/*******************************************/
unsigned char code text1[] = {
0xEF,0x7F,0xEF,0xBC,0x0F,0xDD,0xE0,0xEB,0xEF,0xF3,0x0F,0x8C,0x7F,0xDF,0x7D,0xFF,0x7D,0xBF,0x7D,0x7F,0x0D,0x80,0x75,0xFF,0x79,0xFF,0x7D,0xFF,0x7F,0xFF,0xFF,0xFF,/*”好”,0*/
0xEF,0x7F,0xEF,0xBC,0x0F,0xDD,0xE0,0xEB,0xEF,0xF3,0x0F,0x8C,0x7F,0xDF,0x7D,0xFF,0x7D,0xBF,0x7D,0x7F,0x0D,0x80,0x75,0xFF,0x79,0xFF,0x7D,0xFF,0x7F,0xFF,0xFF,0xFF,/*”好”,1*/
0xBF,0xFF,0xCF,0xFD,0xEF,0xFD,0xED,0xFD,0xA3,0xFD,0xAB,0xFD,0xAF,0xBD,0xAE,0x7D,0xA1,0x80,0x2B,0xFD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