Just open the datasheet and refer to the application diagram of MOC3020. Light dimming application of MOC by gate triggering an SCR is shown. You can connect the circuit directly with a port pin of 8051 or a PIC processor and easily code for firing angle adjustment.