旋转led灯源代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar Disp_Line;
/***********************************************************************/
//时间定义
/***********************************************************************/
uchar Time_H; //时钟"时"(0~23)
uchar Time_M; //时钟"分"(0~59)
uchar Time_S; //时钟"秒"(0~59)
uchar Time_ms; //时钟"毫秒"(0~49) (每过20ms,+1)
uchar Timer1_JSQ;
/***********************************************************************/
//指针定位
/***********************************************************************/
uchar H_Line; //时针定位(0~179)
uchar M_Line; //分针定位(0~179)
uchar S_Line; //秒针定位(0~179)
uchar Disp_time_set; //定时器赋初值
uchar Disp_buffer[10];
/***********************************************************************/
//标志位定义
/***********************************************************************/
bit T20ms_flag; //20毫秒定时溢出标志(0=未溢出,1=溢出)
bit New_disp_flag; //显示刷新使能标志(0=禁止,1=使能)
uchar SET_EN_FLAG;
uchar Disp_mode;
uchar speednow,speed;
uchar k,l,m;
uint Mode_J;
/***********************************************************************/
//显示段码表(模拟表盘)(7*7)
/***********************************************************************/
uchar code LED_TAB_12369[]=
{
0x8C,0x92,0xA2,0xC2,0x84,0x00,0xFE, //12 正向 //0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x82,0x82,0xFC,0x80,0x82,0x7C, //9 左旋270 度 //3
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x92,0x92,0x92,0x92,0x92,0x4C, //6 左旋180 度 //2
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x82,0x2, 0x1C,0x2, 0x82,0x7C, //3 左旋90 度 //1
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
/***********************************************************************/
//数字字模显示段码表(8*8)
/***********************************************************************/