blackcsc
Junior Member level 1
Dear all,
I need help on this simple I/O detect and react c coding.. I'm using AVR Studio as the compiler and below is my codes, i tried alots of time and it jz doesnt works as aspected.. Could anyone help me up with this ? I just want the input detect on the 1st 3 pins on Port D to gives an output at PORTB as pwm signal..
while(1)
{
switch (PIND)
{
case (0x03):
{
OCR1A = 1520;
break;
}
case (0x07):
{
OCR1A = 0; // 0 Degree
break;
}
default:break;
}
}
I need help on this simple I/O detect and react c coding.. I'm using AVR Studio as the compiler and below is my codes, i tried alots of time and it jz doesnt works as aspected.. Could anyone help me up with this ? I just want the input detect on the 1st 3 pins on Port D to gives an output at PORTB as pwm signal..
while(1)
{
switch (PIND)
{
case (0x03):
{
OCR1A = 1520;
break;
}
case (0x07):
{
OCR1A = 0; // 0 Degree
break;
}
default:break;
}
}