Not all single phase motors can be successfully controlled by electronic means. Typically only Shaded Pole motors, such as typically used in cieling fans mentioned above, Universal (AC/DC) motors, such as found in Variable Speed hand tools like drills, and Permanent Split Capacitor (PSC) motors. Other types have issues with capacitors and speed switches that get in the way. What kind of motor do you have?
"Our virtues and our failings are inseparable, like force and matter. When they separate, man is no more."
Nikola Tesla