本帖最后由 followme001 于 2018-2-3 14:08 编辑
u8 const Duan_Data[] =
{
0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F//0,1,2,3,4,5,6,7,8,9
};
u8 const Wei_Data[] =
{
0xFE,0xFD,0xFB,0xF7,0xFF,0xFF,0xFF,0xFF
};
void hc595_in(u8 dat)
{
u8 i;
for (i = 0; i < 8; i++)
{
SCK = 0;
if((dat & 0x80) == 0x80)
{
SIN = 1;
}
else
{
SIN = 0;
}
dat <<= 1;
SCK = 1;
}
}
void hc595_out(void)
{
RCK = 0;
RCK = 1;
} |