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.
hey .. which library needs to be included when we are using the swatch(float secs) function ?? thanks pruthvi
Hmm... delay... There are many different delays: 1. do nothing: { unsigned count = NUMBER_OF_TIKS; while(--count ){;} } 2. only wait for event, for example using timer0 ( timer and interrupts must be configured) unsigned char count ; static void timer0_isr (void) interrupt 1 { ..... if(count)count--; } void func(){ .... count = NUMBER_OF_TIKS; while (count){;} ... } 3. wait and do something else unsigned char count ; bit then_continue; static void timer0_isr (void) interrupt 1 { ..... if(count)count--; } void one(void){ count= NUMBER_OF_TIKS; then_continue=1; } void two(void){ if (!then_continue ) return; if (count) return; .... // delay finished! } void main(void) { count =0; then_continue =0; while (1) { .... if( .... ) one(); // start delay two(); .....// } }