diff --git a/driver.go b/driver.go index ac014c82..8b76c6c3 100644 --- a/driver.go +++ b/driver.go @@ -7,6 +7,7 @@ type Driver struct { Pin string Name string Params map[string]string + Events map[string]chan interface{} } func NewDriver(d Driver) Driver { diff --git a/gobot.go b/gobot.go index a956f9dd..a027f2a0 100644 --- a/gobot.go +++ b/gobot.go @@ -26,4 +26,11 @@ func After(t string, f func()) { func Random(min int, max int) int { rand.Seed(time.Now().UTC().UnixNano()) return rand.Intn(max - min) + min -} \ No newline at end of file +} + +func On(cs chan interface{}) interface{}{ + for s := range cs { + return s + } + return nil +}