Maker Pro
Maker Pro

toggle LED using momentary push buttton

Hello Gentelmen,I am new in programming on PIC and want to program my PIC16F747 for toggle LED.I am using MPLAB X IDE v.3.15 and XC8 compiler.I know that I have to debounce push button to toggle the LED but I don't know how to do that.Help will be appreciated.
 
A mechanical push switch relies on 2 metal contacts touching, in computer terms it will show many button presses from 1 real press..

1. In your code simply wait until contact/button Is pressed and wait about 300ms or longer so that the button is not touched by the end of the delay...

2. A debounce circuit... (several ways)
 
Top