Курсовая работа: Система вимірника струмів
}
//############################################################################################
void init_mega (void)
{
DDRC = 0xFF;
DDRB = 0xFF;
DDRD = 0xFF;
ACSR = 0x80;
ADMUX = ADC_VREF_TYPE;
ADCSRA = 0xEE;
SFIOR = 0x80;
#asm("cli")
TIMSK |= (1 << TOIE0);
TCNT0=Tmr0_Reload;
TCCR0=PrescalerTmr0;
}
//############################################################################################
void convert_out (int a, char position_x, char position_y )
{
int a1, a2, a3, a4;
a1 = a/1000;
lcd_gotoxy(position_x,position_y);
lcd_putchar(a1 + 0x30);
a2 = (a - (a1 * 1000))/100;
lcd_gotoxy(position_x + 1,position_y);
lcd_putchar(0x2C);
lcd_gotoxy(position_x + 2,position_y);
lcd_putchar(a2 + 0x30);
a3 = (a - (a1 * 1000) - (a2 * 100))/10;