dioder

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

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

Go to latest
Published: Dec 16, 2016 License: MIT Imports: 6 Imported by: 2

README

Build Status build status Coverage Status GoDoc

This is an API for the Dioder LED-strips avaliable at IKEA in Germany.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dioder

type Dioder struct {
	sync.Mutex
	PinConfiguration   Pins
	ColorConfiguration color.RGBA
	PiBlaster          string
}

Dioder the main structure

func New

func New(pinConfiguration Pins, piBlasterFile string) Dioder

New creates a new instance

func (*Dioder) GetCurrentColor

func (d *Dioder) GetCurrentColor() color.RGBA

GetCurrentColor returns the current color

func (*Dioder) Release

func (d *Dioder) Release() error

Release releases all used pins, so that they can be used in other applications

func (*Dioder) SetAll

func (d *Dioder) SetAll(colorSet color.RGBA)

SetAll sets the given values for the channels

func (*Dioder) SetChannelInteger

func (d *Dioder) SetChannelInteger(value uint8, channel int) error

SetChannelInteger check if the value is in the correct range and convert it to float64

func (*Dioder) SetColor

func (d *Dioder) SetColor(channel int, value float64) error

SetColor Sets a color on the given channel

func (*Dioder) SetPins

func (d *Dioder) SetPins(pinConfiguration Pins)

SetPins configures the pin-layout

func (*Dioder) TurnOff

func (d *Dioder) TurnOff()

TurnOff turns off the dioder-strips and saves the current configuration

func (*Dioder) TurnOn

func (d *Dioder) TurnOn()

TurnOn turns the dioder-strips on and restores the previous configuration

type Pins

type Pins struct {
	Red   int
	Green int
	Blue  int
}

Pins the numbers of the RGB-pins

Jump to

Keyboard shortcuts

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