pin

package
v0.0.0-...-eeea687 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PWM3  = 3
	PWM5  = 5
	PWM6  = 6
	PWM10 = 10
	PWM11 = 11
)

PWM output pins.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analog

type Analog byte

Analog is an ADC pin.

const (
	A0 Analog = 14
	A1
	A2
	A3
	A4
	A5
)

ADC pins.

func (Analog) Get

func (a Analog) Get() uint16

Get returns analog to digital conversion of a.

type Digital

type Digital byte

Digital is a GPIO pin.

const (
	D0 Digital = iota
	D1
	D2
	D3
	D4
	D5
	D6
	D7
	D8
	D9
	D10
	D11
	D12
	D13
)

GPIO pins.

func (Digital) Get

func (d Digital) Get() bool

Get returns high or low input.

func (Digital) High

func (d Digital) High()

High sets d to source.

func (Digital) Input

func (d Digital) Input(pullup bool)

Input set d to input. If pullup is true, pulls d high.

func (Digital) Low

func (d Digital) Low()

Low sets d to sink.

func (Digital) Output

func (d Digital) Output()

Output sets d to output.

func (Digital) Set

func (d Digital) Set(hi bool)

Set sets d high or low.

type PWM

type PWM byte

PWM is a pin capable of pulse width modulation.

func (PWM) Set

func (p PWM) Set(dutycycle uint16)

Set sets PWM output. Undefined behavior may result if dutycycle > 1023.

Jump to

Keyboard shortcuts

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