Programming the PIC Microcontroller with MBasic

We've learned many techniques for switching DC circuits; high side switching, low side switching, motor drivers and PWM circuits to mention a few. We even briefly looked at switching low voltage, low current AC with a bidirectional optically coupled FET in Chapter 3. This chapter explores controlling 120 V AC power line loads with a PIC. We'll use a 200 watt incandescent lamp load, but the techniques of this chapter can be extended to kilowatt level power switching.
Before we go any further, please stop and read and understand the following warning statement.
The circuits described in this chapter involve working with 120 V AC mains power.
SHOULD YOU COME INTO CONTACT WITH ENERGIZED CONDUCTORS, YOU MAY RECEIVE A DANGEROUS SHOCK, WITH THE POSSIBILITY OF SERIOUS INJURY OR DEATH BY ELECTROCUTION.
If you are not experienced working with 120 V power sources, please do not build the projects described in this chapter.
If you do build these projects, you must observe prudent safety precautions:
Do not under any circumstances work on an energized circuit. Unplug the 120 V portion of the circuit from the power line before working on the circuit. Before touching any circuitry double check to verify that the power line is disconnected.
Do not leave your breadboard circuit unattended. If you are not present, unplug the circuit from the power line.
Use a 3-wire (grounded plug) connection and wiring.
The design shows a 6A fuse and is intended for demonstration use with up to a...