[SOLVED] Delay not working MikroC

Status
Not open for further replies.

renostro

Newbie
Joined
May 18, 2018
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
18
Hello, I am Bruno, I am from brazil and I am new here.I have started to learn C programming for microcontrollers but I have a bug and I don't know what to do.The delay function is not working on Proteus.I am using the not registred version of MikroC pro for pic ( demo version ) 7.2.







 

You forgot to add the delay after the instruction LED=0; as it is, the LED will stay high for 1 second, while it will stay low for only a few CPU machine cycles.
 
Change:
Code:
LED = 1;
Delay_ms(1000);
LED = 0;
to:
Code:
    LED = 1;
    Delay_ms(1000);
    LED = 0;
    Delay_ms(1000);
 
That's true!I spend hours on this lol, Thank you so much!
 

Cristal oscillator will not be simulated. Remove it from schematic. And tell the others.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…