What is the voltage and frequency of the input square wave?
Why don't you use an external interrupt input triggered with both rising and falling edges?
What do you have a 30 second delay inside the interrupt?
Code:
_delay_ms(30000); //And then goes back 0
What is
Code:
switch(ADMUX) //switches between the two analogue inputs and outputs a pulse on Channel A and B
{
case 1: //That is, the output is high. This might have to be changed.
supposed to do?
ADMUX is a 8bit register that has several bits set in your code so how to you expect to ever get a 0b00000001 result?
Alex