Home > other >  At 2.2 boards in dot matrix display bright 0 procedure no problem but is not correct
At 2.2 boards in dot matrix display bright 0 procedure no problem but is not correct

Time:12-02

Great god please check procedure and wiring fault





# include "reg51. H"
# include "intrins. H"

Typedef unsigned char u8;
Typedef unsigned int under-16;

Sbit SRCLK=P3 ^ 6;
Sbit RCLK=P3 ^ 5;
Sbit SER=P3 ^ 4;

U8 ledduan []={0 x00 to 0 x00 to 0 x3e, 0 x41, 0 x41, 0 x41, 0 x3e, 0 x00};
U8 ledwei []={0 x7f, 0 XBF, 0 XDF, 0 xef, 0 xf7, 0 XFB, 0 XFD, 0 xfe};

Void delay (under-16 I)
{
while(i--);
}

Void Hc595SendByte u8 (dat)
{
U8 a;
SRCLK=0;
RCLK=0;
For (a=0; a<8; +)
{
SER=dat> 7. Seven moves to the right////that high
Dat<=1;
SRCLK=1;
_nop_ ();
_nop_ ();
SRCLK=0;
}
RCLK=1;
_nop_ ();
_nop_ ();
RCLK=0;
}

Void main ()
{
u8 i;
While (1)
{
P0=0 x7f;
for(i=0; i<0; I++)
{
P0=ledwei [I];
Hc595SendByte (ledduan [I]);
delay(100);
Hc595SendByte (0 x00);
}
}

}
  • Related