Open kortschak opened 8 years ago
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
Now that ev3 LEDs are handled specifically in ev3, this should just be a generalised LED group and streaming event handler.
Add an ev3 package and start with high-level LED control.
Sketch: