Курсовая работа: Устройство управления системой измерения веса
{
DDRA = 0xff; //Port A pins as output
PORTA = 0x00; //Send 0xFF to PortA output pins
DDRC = 0; //Port C pins as input
PORTC = 0xfe; //Turn ON PullUP for PortC pins
#asm("cli")
TIMSK = (1 << TOIE0)|(1 << OCIE1A); //Enable Timer0 & Timer1 Interrupt
TCNT0 = Tmr0_Reload;
TCCR0 = PrescalerTmr0;
#asm("sei")
}
//== Time wate ====================================
void Time_wate(void)
{
#asm("cli")
TCCR1B = PrescalerTmr1;
OCR1A = comp_t1;
#asm("sei")
while (Tmr1Flag == 0)
{}
}
//== CheckButton ====================================
void CheckButton (void)
{
unsigned char b;
static char OldPortSignal;
static char OldOldPortSignal;
NewPortSignal = PINC&1; //select PC0 - START_button
b = PINC&7; //select PC1,PC2 - bunker sensors