PostPosted: Sat May 31, 2008 8:30 am Post subject:
if (GPIO & (1<<0)) return 0; // no key yet
doesn't test for bit 5! 1 << 0 doesn't do any shifting, anyway. It's the same as
if (GPIO & 1) return 0; // no key yet
Try something much simpler like flashing an LED first, and then turn it on and off with the switch.
THat was from working code on a 12f683. I changed GPIO to PORTA and 1<<0 to PORTA.0. Ingnore the comments I never changed them when i changed the code. SO how do I port the about debounce sequence to work with a 16f684.
I have no problem flashing the led. The problem is that It starts flashing as soon as I connect power and does not wait for switch detection.