Switch handling can be found in the examples in the IDE.
This example generates a 10Khz signal:
#include <TimerOne.h>
//UNO only
void setup()
{
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
Timer1.initialize(100); // Frequency, 100us = 10khz
Timer1.pwm(9,512); // 50% DC on pin 9
//Timer1.pwm(10,255); // 25% DC on pin 10
// D.C.
// 10KHz
// You can use 2 to 1023
// 0 & 1 gives a constant LOW
// 1024 gives a constant HIGH
// 2 gives ~125ns HIGH pulses
// 1023 gives ~125ns low pulses
// 512 gives 50us
}
void loop()
{
}
Timer1.initialize(100); // Set frequency here
Changing voltage output levels will need external design.
You may be able the use various series diodes to lower the output levels as needed.