That is right. But the Servo_ATTinyCore library that comes with the ATTinyCore core is compatible with the tiny85 and the tiny45.
The (modified) knob example. Tested and works with my tiny85 ( I do not have a tiny45).
/*
Controlling a servo position using a potentiometer (variable resistor)
potentiometer wiper to A2 (physical pin 3.
servo to pin 3 (physical pin 2).
optional LED to pin 0 (physical pin 5).
If Servo library is installed to libraries, then that version (which doesn't support ATtiny parts)
will be used instead of the one included with the core, which does. To get around this,
include Servo_ATTinyCore.h instead - this will always use the version that came with core.
*/
#include <Servo_ATTinyCore.h>
Servo myservo; // create servo object to control a servo
const byte potpin = A2; // analog pin used to connect the potentiometer
const byte servoPin = 3;
const byte ledPin = 0; // optional
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(servoPin); // attaches the servo on pin 9 to the servo object
pinMode(ledPin, OUTPUT);
}
void loop()
{
static unsigned long timer = 0;
unsigned long interval = 50;
if (millis() - timer >= interval)
{
timer = millis();
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 10, 170); // scale it to use it with the servo (value between 0 and 180)
//digitalWrite(ledPin, !digitalRead(ledPin));
analogWrite(ledPin, val); // visual indication of pot reading OPTIONAL
myservo.write(val); // sets the servo position according to the scaled value
}
}