Is it possible to use a potientiometer, or perhaps a time varying resistor?

Also, is there a way to use a spdt relay?