pca9685

package module
v0.0.0-...-d51ab41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

pca9685

Yet another library for driving servos via a PCA9685 chip. These chips are used in many popular i2c-interface PWM controller boards compatible with the Arduino, Raspberry Pi, and other single board computers and microcontrollers. Clean and simple, uses gobot for backend. Includes a simple servo calibration tool. See ./examples.

Written in part because the gobot ServoDriver library only uses 8 bits of resolution, while the pca9685 chip supports 12 bits. This library uses all 12 bits.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Servo

type Servo struct {
	Freq       float32
	PulseMin   time.Duration
	PulseMax   time.Duration
	AngleRange float32
	// contains filtered or unexported fields
}

func NewServo

func NewServo(pca9685 *i2c.PCA9685Driver, channel int) (s *Servo)

func (*Servo) Angle

func (s *Servo) Angle(angle float32) (t Trace)

type Trace

type Trace struct {
	Period     time.Duration
	Angle      float32
	AnglePct   float32
	PulseRange time.Duration
	OffTime    time.Duration
	OffTicks   uint16
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL