Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ev3dev: add high-level LED control #5

Open
kortschak opened this issue Apr 18, 2016 · 1 comment
Open

ev3dev: add high-level LED control #5

kortschak opened this issue Apr 18, 2016 · 1 comment

Comments

@kortschak
Copy link
Member

kortschak commented Apr 18, 2016

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
@kortschak kortschak changed the title ev3: new package add high-level LED control ev3dev: add high-level LED control May 15, 2016
@kortschak
Copy link
Member Author

Now that ev3 LEDs are handled specifically in ev3, this should just be a generalised LED group and streaming event handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant