We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am sure this a newbie question but I don't know where I can find the answer.
I don't know how to change a variable inside an interrupt I've created.
The problem is that keil give an error of non-defined for any variable wich I modified inside my interrupt function that I've declared on the main program.
I've proved to create the same variabble inside the function interrupt code but it gives another error.
Can anyone tell me how you can create a variable that can be modified in the interrupt function and in the main program?
Thanks.
It's pretty certain that interrupts have nothing to with that, actually. What you don't know is how to share a variable between different functions, or between different source files.
For more specific answers, you'll have to ask a better question. Instead of
keil give an error
you have to show that error message, verbatim. And you'll have to show what your code actually looks like. Reduce it to the smallest compilable example case that still shows your problem.