function delay_us(variable)

General discussion on Libstock website & codes posted on this website.
Post Reply
Author
Message
HOSSIN
Posts: 1
Joined: 29 May 2019 23:23

function delay_us(variable)

#1 Post by HOSSIN » 29 May 2019 23:42

Hello.
I'm using a pic18f45k22 for application to generat a PWM signals and i want to change their times . besides I want to use a variable in the instruction delay_us(variable) but the compiler MIKROC d'ont accept this, my question what is the better solution for this?

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: function delay_us(variable)

#2 Post by jovana.medakovic » 31 May 2019 09:58

Hello,

You have to declare x as global:
const unsigned long x = 100;

and after that, you can write:
Delay_us(x);

Kind regards,
Jovana

Post Reply

Return to “Libstock Discussion”