pwm

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

This module provides the ability to do pulse-width-modulation (PWM) on GPIO pins, affecting both the period of the pulses and the "duty cycle" which determines how long a pulse is "high" for, compared to the "low" state.

RASPBERRY PI IMPLEMENTATION

The Raspberry Pi implementation uses "Pi Blaster" which can be cloned from https://github.com/sarfata/pi-blaster and installed using the following set of commands:

git clone https://github.com/sarfata/pi-blaster
cd pi-blaster/
sudo apt-get install autoconf
./autogen.sh && ./configure && make
sudo make install

This will run the system daemon and you will end up with a named pipe called /dev/pi-blaster

You can then run the included pwm_ctrl command in order to control the PWM function. For example:

go run -tags rpi ./cmd/pwm_ctrl/...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFrequency

func ParseFrequency(value string) (time.Duration, error)

ParseFrequency converts a string into a period. It will return an error if the string could not be parsed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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