rostyslav
New Member
Code:
/*****************************************************
******/
#include <mega168.h>
void main(void)
{
PORTB=0x5D;
DDRB=0x00;
PORTC=0x00;
DDRC=0x00;
PORTD=0xE0;
DDRD=0xFF;
while (1)
{
if (PORTB==0)
{
PORTD=1;
}
if (PORTB==1)
{
PORTD=0;
}
}
}
Why does not work? Pin does not change to High and Low.