Code not excuting correctly the delay is not working at all any help is appreciated

98 views Asked by At

Delay is not working after burning the code on at mega i tried most of stuff i found online but nothing worked any help is highly appreciated thanks in advance.

while (1)
      {
      PORTC.0 == 1 ;
      delay_ms(2000);
      PORTC.0 == 0 ; 
      delay_ms(2000); 

      }
}```
1

There are 1 answers

0
mitchell On

I believe you want just delay()

Also, you don't want to use the comparison operator ==. You want to use the assignment operator =. I am assuming that you are trying to blink an LED on and OFF

https://www.arduino.cc/reference/en/language/functions/time/delay/