#include
# include "absacc. H"
# define uint unsigned int
# define uchar unsigned char
# define PA8255 XBYTE [0 xff7c]
# define PB8255 XBYTE [0 xff7d]
# define COM8255 XBYTE [0 xff7f]
Sbit S1=P3 ^ 2;
Void delay (uint t);
Uchar time []={x5b x3f 0, 0 x06, 0, 0, x4f x66 0, 0 x6d, 0 x7d, 0 x07, 0 x7f, 0 x6f, 0 x01};
Uchar a=0, b=0;
Void main ()
{
COM8255=0 x80;
EA=1;
EX0=1;
IT0=1;
TMOD=0 x55;
TH0=0 XFF;
TL0=0 XFF;
TH1=0 XFF;
TL1=0 XFF;
PX0=0;
PA8255=0 x00;
PA8255=0 x00;
While (1)
{
PB8255=time [a];
PA8255=time [b];
Delay (1000);
+;
If (time [b]==0 x7d) b=0;
If (time [a]==0 x01) a=0, b++;
}
}
Void ting () interrupt 0
{
Uchar n=100;
PB8255=0 x00;
PA8255=0 x00;
Delay (1000);
ET0=1;
CodePudding user response:
Interrupt delay inside (1000), timid to really fatCodePudding user response:
Ha ha, you get a sign not to goCodePudding user response:
Programming requirements are as follows:Interrupt service routine to the shorter, the better,
Generally buy a logo in the interrupt service routine, and then processing in the main program,
For example:
A serial port receives the data, the only read serial data in the interrupt service routine, and then put logo, finally according to the logo in the main program to parse,
CodePudding user response: