Noureldin Mahmoud
Noureldin Mahmoud

Reputation: 1

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

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); 

      }
}```

Upvotes: -6

Views: 134

Answers (1)

mitchell
mitchell

Reputation: 286

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/

Upvotes: 0

Related Questions