Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
volatile int counter;
void TimerInterrupt(void) // interrupt service routine triggered e.g. by timer interrupt
{
counter++;
}
void main(void)
{
counter = 0;
while(1)
{
if (counter == 5) DoSomething(); // without volatile declaration this line wouldn't be processed as counter isn't changed here
}
}