rotaryencoder

package
v0.0.0-...-4c711ad Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Dir    chan int
	Switch chan bool
	// contains filtered or unexported fields
}

Device represents a rotary encoder.

func New

func New(pinA, pinB, pinS mcp23017.Pin) Device

New creates a new rotary encoder.

func (*Device) Configure

func (enc *Device) Configure()

Configure configures the rotary encoder.

func (*Device) Range

func (enc *Device) Range() (int, int)

Returns the current defined range for the encoder

func (*Device) SetRange

func (enc *Device) SetRange(bottom int, top int)

Sets the possible value range for the encoder This won't be used until the next tick

func (*Device) SetValue

func (enc *Device) SetValue(v int)

SetValue sets the value of the rotary encoder.

func (*Device) SwitchWasClicked

func (enc *Device) SwitchWasClicked() bool

SwitchValue returns the value of the switch.

func (*Device) Update

func (enc *Device) Update(aHigh bool, bHigh bool)

func (*Device) UpdateSW

func (enc *Device) UpdateSW(pinState bool)

func (*Device) Value

func (enc *Device) Value() int

Value returns the value of the rotary encoder.

Jump to

Keyboard shortcuts

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