Generating delay , counter function in Attiny85 programming .

Hello everyone,

I am working on "ATtiny85"of AVR family, program through Arduino IDE and i am trying to generate counter or delay function. I have used Timer 1 for PWM generation and simultaneously i used delay or millis() function for delay event.

I need to change PWM signal when delay start.. delay length is between 1 hour to 8 hour...

For PWM generation or changing PWM I used Switch case....

How can change the PWM signal in case if Delay operation executing ...

Thanks,

Your code now would contain a statement similar to,analogWrite(pmw_pin, duty_cycle);
When your delay is complete, simply issue a new analogWrite with the new duty_cycle.

You need to read the article pinned to the top of this forum: Using millis() for timing. A beginners guide - Introductory Tutorials - Arduino Forum
It explains how to use millis() to achieve a delay while still being able to do other things.