You can't use resistors for dimming room lighting, unless you like wasting power and have big high power resistors that can dissipate all that power without catching fire. Most of the power that's not going into the dimmed bulb just gets dissipated as heat.
AC dimming must be done with a thyristor, as that other link describes. The idea is to have the thyristor on for only part of each AC cycle, and how much of that time it's on for determines the brightness.
As an aside, there do exist "digital potentiometers", potentiometers that can be controlled over SPI or I2C. However, these are universally low current devices, lower than normal potentiometers - they're totally unsuited for this task.
You also need to make sure the lights you are using are dimmable. Many fluorescents and LED lights won't operate properly on a dimmer, so make sure the box says that they are dimmable.
Triac, not thyristor. A triac is like a thyristor that works with both polarities of voltage/current.
Thyristors are also known as SCRs (silicon controlled rectifiers).
Mains voltages are lethal and appropriate care has to be taken when working with
such circuits - if in doubt, DON'T!!!