资源描述:
《旋转led灯源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#defineucharunsignedchar#defineuintunsignedintucharDisp_Line;/***********************************************************************///时间定义/***********************************************************************/ucharTime_H;//时钟
2、"时"(0~23)ucharTime_M;//时钟"分"(0~59)ucharTime_S;//时钟"秒"(0~59)ucharTime_ms;//时钟"毫秒"(0~49)(每过20ms,+1)ucharTimer1_JSQ;/***********************************************************************///指针定位/***********************************************************************/
3、ucharH_Line;//时针定位(0~179)ucharM_Line;//分针定位(0~179)ucharS_Line;//秒针定位(0~179)ucharDisp_time_set;//定时器赋初值ucharDisp_buffer[10];/***********************************************************************///标志位定义/*************************************************************
4、**********/bitT20ms_flag;//20毫秒定时溢出标志(0=未溢出,1=溢出)bitNew_disp_flag;//显示刷新使能标志(0=禁止,1=使能)ucharSET_EN_FLAG;ucharDisp_mode;ucharspeednow,speed;uchark,l,m;uintMode_J;/***********************************************************************///显示段码表(模拟表盘)(7*7)/************
5、***********************************************************/ucharcodeLED_TAB_12369[]={0x8C,0x92,0xA2,0xC2,0x84,0x00,0xFE,//12正向//00x00,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,
6、0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x82,0x82,0xFC,0x80,0x82,0x7C,//9左旋270度//30x00,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,0x0
7、0,0x00,0x00,0x00,0x00,0x00,0x7C,0x92,0x92,0x92,0x92,0x92,0x4C,//6左旋180度//20x00,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,0
8、x7C,0x82,0x2,0x1C,0x2,0x82,0x7C,//3左旋90度//10x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x