Слайд 12Пример кода
void DisplayValue(unsigned long value)
{
char i;
unsigned long V;
unsigned long digit;
unsigned int code;
unsigned char code_low, code_high;
V = AcpValues[AcpChannel];//
PORTB = 0;
PORTB = 0b00010000;
PORTB = 0;
Слайд 13Пример кода
for(i = 0; i < 5; i++)
{
digit = V %
10;
V = V / 10;
code = mas8[digit];
code_low = (code >> 0) & 0xF;
code_high = (code >> 4) & 0xF;
PORTB = code_low | 0b01010000;
PORTB = code_low | 0b01000000;
PORTB = code_high | 0b01010000;
PORTB = code_high | 0b01000000;
}
Слайд 14Пример кода
PORTB = 0b01010000;//пропуск сегментаов
PORTB = 0b01000000;
PORTB = 0b01010000;
PORTB = 0b01000000;
PORTB =
0b01010000;
PORTB = 0b01000000;
PORTB = 0b01010000;
PORTB = 0b01000000;//пропуск сегментаов