winnie mong
Junior Member level 3
- Joined
- Sep 8, 2013
- Messages
- 26
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 366
hi guys....
i have an interrupt function from a library i am using and i want to use it to produce a clock for my timer.please have a look at what i tried to produce and kindly provide your assistance by indicating where i could have gone wrong..thanks
here i have the function from the library
my effort in producing the clock
using the function in main()
i have an interrupt function from a library i am using and i want to use it to produce a clock for my timer.please have a look at what i tried to produce and kindly provide your assistance by indicating where i could have gone wrong..thanks
here i have the function from the library
Code C - [expand] 1 2 3 4 5 6 7 8 9 interrupt isr(void) { if(T0IF) { ++pulses; // increment pulses T0IF=0; // reset TMR0 flag } }
my effort in producing the clock
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 extern unsigned char pulses; { sec=0; min=0; hour=0; void clock() { stop=pulse+160; if(++sec==60){ min++; } if(++min==60){ hour++; } if(++hour==24){ hour=0; } }
using the function in main()