Documentation
¶
Index ¶
- type ADC
- type ADCHandler
- type ButtonHandler
- type Column
- type LED
- type Monome
- func (m *Monome) ADC(n uint) *ADC
- func (m *Monome) ADCChanged(ah ADCHandler)
- func (m *Monome) Brightness(v float64) error
- func (m *Monome) ButtonChanged(bh ButtonHandler)
- func (m *Monome) Clear() error
- func (m *Monome) Close()
- func (m *Monome) Column(x uint) *Column
- func (m *Monome) LED(x, y uint) *LED
- func (m *Monome) LEDTest(on bool) error
- func (m *Monome) Loop() error
- func (m *Monome) Open() error
- func (m *Monome) Row(y uint) *Row
- func (m *Monome) Shutdown() error
- func (m *Monome) Write(message [2]byte) error
- func (m *Monome) WriteState() error
- type Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADC ¶
type ADC struct {
// contains filtered or unexported fields
}
ADC represents a ADC input.
type ADCHandler ¶
ADCHandler is a function that can be run when an ADC message is received.
type ButtonHandler ¶
ButtonHandler is a function that can be run when a Button message is received.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column reperesents a single column of LEDS on the monome.
type LED ¶
type LED struct {
// contains filtered or unexported fields
}
LED represents a single LED on the monome.
type Monome ¶
type Monome struct {
Debug bool
// contains filtered or unexported fields
}
Monome is the type that looks after the configuration, serial port, and LED state of a given monome 40h.
func NewMonome ¶
NewMonome returns a new Monome with the given serial port path and default serial configuration.
func NewMonomeConfig ¶
NewMonomeConfig returns a new Monome with a given `*serial.Config`
func (*Monome) ADCChanged ¶
func (m *Monome) ADCChanged(ah ADCHandler)
ADCChanged adds a ADC handler
func (*Monome) Brightness ¶
Brightness sets the brightness of all LEDs given by a float between 0 and 1 inclusive. 0 is off, 1.0 is full brightness.
func (*Monome) ButtonChanged ¶
func (m *Monome) ButtonChanged(bh ButtonHandler)
ButtonChanged adds a Button handler
func (*Monome) LED ¶
LED returns a given LED on the given Monome, clamping the values of x and y to 0-7.
func (*Monome) LEDTest ¶
LEDTest tells the device to turn on or off all of the LEDs without updating internal state.
func (*Monome) Loop ¶
Loop reads continuously from the monome, calling a handler when messages are recieved.
func (*Monome) WriteState ¶
WriteState updates all LEDs on the device to match the stored state.