Skip to content

chrisdambrosio/adafruit-servo-driver

Repository files navigation

Adafruit Servo Driver

CodeClimate

Description

A Ruby implementation of Adafruit's Python library for the Adafruit PCA9685 16-Channel PWM Servo Driver for use with the Raspberry Pi.

Installation

gem install adafruit-servo-driver

Usage/Example

require 'adafruit-servo-driver'

pwm = PWM.new(0x40, true)
pwm.set_pwm_freq(50)

channel = 0

3.times do
  pwm.set_pwm(channel, 0, 212)
  sleep(0.5)
  pwm.set_pwm(channel, 0, 412)
  sleep(0.5)
end

Relevant Links:

Product Page: http://www.adafruit.com/products/815

Original Adafruit Python Adafruit_PWM_Servo_Driver Library: https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_PWM_Servo_Driver

Tutorial: Adafruit 16 Channel Servo Driver with Raspberry Pi http://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi

Inspiration for usage example: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=32826

About

Ruby i2c interface for the Adafruit PCA9685 Servo Driver and Raspberry Pi

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages