hardware

package
v1.0.0-beta68 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputEvent

type InputEvent struct {
	Sector     int
	Multiplier int
}

An InputEvent holds board input event.

type InputEventConsumer

type InputEventConsumer interface {
	// Prepare() error
	Consume(event InputEvent)
	Shutdown()
}

InputEventConsumer can consume InputEvent

type InputEventProducer

type InputEventProducer interface {
	Produce(inputEventChannel chan InputEvent)
	Shutdown()
}

InputEventProducer is waiting for hardware event and push then in the chan.

type MockedHardware

type MockedHardware struct {
	// contains filtered or unexported fields
}

A MockedHardware uses keyboard input instead of electronic dart board.

func NewMockedHardware

func NewMockedHardware() *MockedHardware

NewMockedHardware create a new NewMockedHardware.

func (*MockedHardware) Produce

func (mock *MockedHardware) Produce(inputEventChannel chan InputEvent)

Produce is the event-loop responsible of producing the InputEvent based on keyboard input.

func (*MockedHardware) Shutdown

func (mock *MockedHardware) Shutdown()

Shutdown release all the resources.

type WiredHardware

type WiredHardware struct {
	// contains filtered or unexported fields
}

WiredHardware is actually listening for hardware events.

func NewWiredHardware

func NewWiredHardware(runCalibration bool) *WiredHardware

NewWiredHardware create a new NewWiredHardware.

func (*WiredHardware) Produce

func (hardware *WiredHardware) Produce(inputEventChannel chan InputEvent)

Produce is the main event-loop reading the hardware matrix and producing InputEvent.

func (*WiredHardware) Shutdown

func (hardware *WiredHardware) Shutdown()

Shutdown releases all the GPIO pins.

Jump to

Keyboard shortcuts

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