Bruno. Reading between the lines, and adding a generous dose of imagination, I believe you might be trying to replace the mechanical pot on something like a light dimmer with a digital pot, so that you can adjust the dimmer with your microcontroller.
If that is indeed the case, the best way would be to use phase control of a triac like what romsimpson shows in post 10. But that puts your microcontroller at the high voltage mains supply which, unless you're very careful, might get yourself or someone else hurt. A better version of the circuit would be to use opto couplers to isolate the control circuitry from the mains voltage.
But, let me suggest something simpler. Just use a small servo or stepper motor to drive the shaft of the existing pot on the dimmer.