2016-12-19 23:21:47 +08:00
|
|
|
package bb8
|
|
|
|
|
|
|
|
import (
|
2017-02-02 23:42:43 +08:00
|
|
|
"gobot.io/x/gobot"
|
2016-12-23 16:23:18 +08:00
|
|
|
"gobot.io/x/gobot/platforms/ble"
|
2016-12-19 23:21:47 +08:00
|
|
|
"gobot.io/x/gobot/platforms/sphero/ollie"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Driver represents a Sphero BB-8
|
2016-12-23 16:23:18 +08:00
|
|
|
type BB8Driver struct {
|
2016-12-19 23:21:47 +08:00
|
|
|
*ollie.Driver
|
|
|
|
}
|
2016-12-23 16:23:18 +08:00
|
|
|
|
|
|
|
// NewDriver creates a Driver for a Sphero BB-8
|
|
|
|
func NewDriver(a *ble.ClientAdaptor) *BB8Driver {
|
2016-12-23 16:36:16 +08:00
|
|
|
d := ollie.NewDriver(a)
|
2017-02-02 23:42:43 +08:00
|
|
|
d.SetName(gobot.DefaultName("BB8"))
|
2016-12-23 16:36:16 +08:00
|
|
|
|
2016-12-23 16:23:18 +08:00
|
|
|
return &BB8Driver{
|
2016-12-23 16:36:16 +08:00
|
|
|
Driver: d,
|
2016-12-23 16:23:18 +08:00
|
|
|
}
|
|
|
|
}
|