最近整理资料,看见这个之前做的摇摇棒,是基于51单片机的,下面把源程序贴出来,有任何问题欢迎留言!
#include
#define uchar unsigned char
#define uint unsigned int
sbit key = P3^0;//定义切换画面开关
uchar Key_num;//定义按键次数
uchar Int0_num=0;//定义中断次数
uchar Direction;//定义摇动方向(从左到右)
uchar code Embed[]={
0x40,0x00,0x20,0x00,0xd0,0x3f,0x4c,0x40,0x43,0x40,0x44,0x42,0x48,0x44,0xd8,0x43,
0x30,0x78,0x10,0x00,0x00,0x00,0xfc,0x07,0x00,0x20,0x00,0x40,0xff,0x3f,0x00,0x00,
0x20,0x21,0x24,0x11,0x2c,0x4d,0x35,0x81,0xe6,0x7f,0x34,0x05,0x2c,0x59,0x24,0x21,
0x00,0x18,0xfc,0x07,0x24,0x00,0x24,0x00,0xe2,0xff,0x22,0x00,0x22,0x00,0x00,0x00,
0x00,0x00,0x10,0x82,0x0c,0x82,0x04,0x42,0x4c,0x42,0xb4,0x23,0x94,0x12,0x05,0x0a,
0xf6,0x07,0x04,0x0a,0x04,0x12,0x04,0xe2,0x14,0x42,0x0c,0x02,0x04,0x02,0x00,0x00,
0x02,0x08,0xfa,0x08,0x82,0x04,0x82,0x24,0xfe,0x40,0x80,0x3f,0x40,0x22,0x60,0x2c,
0x58,0x21,0x46,0x2e,0x48,0x20,0x50,0x30,0x20,0x2c,0x20,0x23,0x20,0x20,0x00,0x00,
0x