ATtiny85 servo library using timer1, up to 5 servos

Having recently starting using ATtiny85, I found that servo solutions were limited and often used delays.

So I borrowed code from the Arduino supplied servo library and rewrote it to allow 5 servos using 8 bit timer1. This allows delay() to be used elsewhere in your code.

The attached test program operates 2 servos with the servo angles controlled by a pot and the angles displayed on a LiquidCrystalI2C device using TinyWireM library. (So basically using all the ATtiny85 outputs.)

The attached library mirrors the use of the default <servo.h> but is just for the ATtiny85.

ServoATtiny85.cpp (6.55 KB)

ServoATtiny85.h (2.71 KB)

ServoLibTest.ino (1.13 KB)

1 Like