this is a simple code to call a function named repetition when i call him 8 leds attached to port b go on and off for 10 times given that am using mikroc pro for pic
but the simulation is not doing the needed task
i also have another problem guys some times the simulation works fine but the real circuit dont do the needed job this happens when i am calling a function to do a certain job
my pic (16f877a) is programming well and my circuit is 100% accurate is it a problem in my MIKROc or in my programmer but my programmer programs well :/
Code:
void repetition(char ww,int yy)
{
char y,x;
for(y=0;y<10;y++){
PORTB=ww;
for(x=0;x<yy;x++)delay_ms(1);//delay one second since the value of yy is 1000
PORTB=0;
delay_ms(1000);
}
}
void main()
{
TRISB=0;
repetition(255,1000);
}
i also have another problem guys some times the simulation works fine but the real circuit dont do the needed job this happens when i am calling a function to do a certain job
my pic (16f877a) is programming well and my circuit is 100% accurate is it a problem in my MIKROc or in my programmer but my programmer programs well :/
Last edited by a moderator: