For some reason i can't use a variable to use with delay_us() with Mikro for a PIC, I am making like a homemade PWM since my pic doesn't support it
That brings up the error of "Integral constant expected" for "delay_us(delay);"
However if i used say delay_us(5); it works completely fine?
thanks for any help
Rich (BB code):
unsigned int delay;
void main(){
TRISB = 0;
PORTB = 0;
delay = 0;
while(1){
PORTB = 0xff;
delay_us(1);
PORTB = 0;
delay_us(delay);
if(delay < 50000){
delay++;
}
else{
delay--;
}
}
}
However if i used say delay_us(5); it works completely fine?
thanks for any help