This example shows you how to create multiple non-blocking delays with only one timer, using :
- timer 1
- interrupts
- arrays of pointers to functions
- structures
/* * this source code shows how to use pic timers, interrupts,
and arrays of pointers to functions
* and how to make non-blocking multiples delays, using a single timer
*
* Bruno Gavand, march 2006
* www.micro-examples.com
*
* P18F452 @8Mhz, HS clock, EASYPIC2 / EASYPIC3
* pull-down on PORTB
* pull-up on keyboard
* enable PORTB, PORTC and PORTD LEDs
*
* pressing RB0 key will toggle PORTC after a 2s non-blocking delay
* pressing RB1 key will toggle PORTD after a 3s non-blocking delay
*
* used ROM : 1676 bytes
*/
More click on title..