Skip to content

ev3dev: add high-level LED control #5

Description

@kortschak

Add an ev3 package and start with high-level LED control.

Sketch:

type LED struct { ... }

func NewLED(s Side) *LED
func (l *LED) Color() (color.Color, error)
func (l *LED) SetColor(color.Color) *LED
func (l *LED) Trigger() (Trigger, error)
func (l *LED) SetTrigger(Trigger) *LED
func (l *LED) Pattern([]time.Duration) *LED
func (l *LED) Stream(<-chan time.Duration) *LEDStream
func (l *LED) Err() error

type Side byte

const (
    Left Side = 1 << iota
    Right
}

type Trigger string

const (
    None Trigger = "none"
    MMC0 ... etc
    Timer
    Heartbeat
    DefaultOn
    Transient
    BatteryChargingOrFull
    BatteryCharging
    BatteryFull
    BatteryChargingBlinkFullSolid
    RFKill0
)

type LEDStream struct { ... }

func (l *LEDStream) Waiter() <-chan error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions