hallo
ich habe hier eine 6 stellige multiplex anzeige mit ca. 1khz programmiert. wie könnte ich das programm umändern dass sie ca mit 0,5 sek. scrollt.
das problem ist ja dass sie schon gemultiplexed wird.jetzt mußte ich sie aber nocheinmal multiplexen, wenn ich mich nicht täusche
Code:
#include <reg167.h>
#include <intrins.h>
char hex[]= { 0xC0, //0
0xF9, //1
0xA4, //2
0xB0, //3
0x99, //4
0x92, //5
0x82, //6
0xF8, //7
0x80, //8
0x90, //9
0x88, //A-10
0x83, //b-11
0xC6, //C-12
0xA1, //d-13
0x86, //E-14
0x8E //F-15
};
void main(void)
{
DP2= 0x003F;
DP8= 0x00FF;
IEN= 1;
T3CON= 0x00C0;
T3= 0x09C4;
T3IC= 0x0045;
T2CON= 0x00E0;
T2= 0x09C4;
T2IC= 0x0045;
while(1)
{
_idle_();
}
}
void segment(void) interrupt 35
{
static int i;
for(i=1; i<=6; i++)
{
P2=0x0003F;
switch(i)
{
case 1:
P8= hex[0];
P2=0x003E;
break;
case 2:
P8= hex[1];
P2=0x003D;
break;
case 3:
P8= hex[2];
P2=0x003B;
break;
case 4:
P8= hex[3];
P2=0x0037;
break;
case 5:
P8= hex[4];
P2=0x002F;
break;
case 6:
P8= hex[5];
P2=0x001F;
break;
default:
P8=0x00;
P2=0x00;
break;
}
if (i==6)
i=1;
}
}
danke
mfg
Lesezeichen