Timer1 interrupt driven servo library for Atmel ATTiny x61 series microcontrollers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Servo_x61
.gitignore
LICENSE
README.md

README.md

Servo_x61

Timer1 (8 bit) interrupt driven servo library for Atmel ATTiny x61 series microcontrollers. Adapted from ServoTimer2 library. This library uses Timer1 hardware interrupt to control up to 8 servos using an ATTiny x61 series microcontroller. It is compatible with ATTinyCore. This only works correctly when CPU speed is set to 8 MHz.

Usage

The public interface is meant to mirror the Arduino Servo library.

Example

#include "Servo_x61.h"

// Attach servo on pin 6 (PB3).
int servoPin = 6;

Servo_x61 servo;

void setup() {
  servo.attach(servoPin);
}

void loop() {

  // Rotate the servo from 0 to 180 degrees.
  for (int i = 0; i < 180; i++) 
  {
      servo.write(i);
      delay(500);
  }
}