i need some help to drive 2 74595 and 4 digits 7 segment
the high byte for digit data and low byte to active one digit of 7 segment
Code: Select all
unsigned test;
void SendTowBytes (unsigned int TowBytes)
{
unsigned short stb;
RCLK = 0;
for (stb = 0; stb < 16; stb++)
{
SCLK = 0;
if (TowBytes & 0x8000) DIO = 1;
else DIO = 0;
SCLK = 1;
TowBytes <<= 1;
}
RCLK = 1; /// to active outputs
}
void main (void)
{
while (1)
{
test = ("high byte here" << 8) + "low byte here";
SendTowBytes (test);
}
}