Event.c中做如下处理:
static byte *OEGA_ACT[6] =
{
charLED,
charLED,
numLED,
numLED,
numLED,
numLED
}; //定义LED显示各位的指针数组
unsigned int speed =258; //定义一个要显示的实际值
unsigned int CharOrNumOffset[6];//定义指针数组各指针的偏移量数组
byte *CharSend[6]; //定义指针数组各指针加上偏移量之后的指针数组
unsigned int length1,length2;//数组长度
中断事件代码处理内容:
#pragma interrupt called
void TI1_OnInterrupt(void)
{
/* Write your code here ... */
unsigned int i;
Bit1_ClrVal();
length1 = sizeof(OEGA_ACT)/2;//12
length2 = sizeof(*OEGA_ACT);//2
transValueLed(speed,CharOrNumOffset,flagSPEED);
for(i=0;i
{
*(CharSend+i) = *(OEGA_ACT+i)+*(CharOrNumOffset+i);
}
SM1_SendChar(*(*(CharSend+0)));
SM1_SendChar(*(*(CharSend+1)));
SM1_SendChar(*(*(CharSend+2)));
SM1_SendChar(*(*(CharSend+3)));
SM1_SendChar(*(*(CharSend+4)));
SM1_SendChar(*(*(CharSend+5)));
Bit1_SetVal(); //锁存
Bit1_ClrVal(); //锁存
}
文章评论(0条评论)
登录后参与讨论