No, There are at least three mistakes:
#1. You need some capacitance across the the power supply leads of the PIC and at the output of the regulator. I recommend a 10uf and a .1uf in parallel.
#2. Pin 4 will never go LOW. Connect the "bottom" of the switch to a 10K resistor. Connect the other end of that resistor to GND. Connect the junction of the switch and the resistor to pin 4.
#3. The LED will not be bright enough with a 10K resistor in series. Try a 1K instead.
Bookmarks