4.void display(unsigned int n)
最为关键的显示函数
void display(unsigned int n)
{
static unsigned int thousand_bit, hundred_bit, ten_bit, single_bit;
thousand_bit = n / 1000;
hundred_bit = (n % 1000) / 100;
ten_bit = n % 1000 % 100 / 10;
single_bit = n % 10;
HC595_Send_Data(num[thousand_bit], 3);
HC595_Send_Data(num[hundred_bit], 2);
HC595_Send_Data(num[ten_bit], 1);
HC595_Send_Data(num[single_bit], 0);
}
|