Hi,
I'm never good at getting a timer to work. I'm wondering if anyone can provide some help.
I want to do the following things:
- when 2 copper sheets come in contact for OVER 2 seconds, the PIC sends a signal to its output pin and lights up a LED
- if the contact is less than 2 seconds, ignore it
I set up a counter variable in my code so that when the sheets first come in contact, the counter starts counting. When it reaches certain number e.g 250, I set the output pin to HIGH and reset the counter to 0. However, it doesn't work because once the sheets touch, the LED lights up right away.
(by increasing the number from 250 to 300 doesn't work either. this time no LED is lit at all)
Any suggestion or advice would be greatly appreciated! Thanks a lot!
Bookmarks