func (d *DirectPinDriver) On() (err error) {
	if writer, ok := d.Connection().(DigitalWriter); ok {
		return writer.DigitalWrite(d.Pin(), byte(1))
	}
	err = ErrDigitalWriteUnsupported
	return
}
Turn On pin
package gpio
import (
	"strconv"
	"github.com/hybridgroup/gobot"
)
type DirectPinDriver struct {
	name       string
	pin        string
	connection gobot.Connection
	gobot.Commander
}
func NewDirectPinDriver(a gobot.Connection, name string, pin string) *DirectPinDriver {
	d := &DirectPinDriver{
		name:       name,
		connection: a,
		pin:        pin,
		Commander:  gobot.NewCommander(),
	}
	d.AddCommand("DigitalRead", func(params map[string]interface{}) interface{} {
		val, err := d.DigitalRead()
		return map[string]interface{}{"val": val, "err": err}
	})
	d.AddCommand("DigitalWrite", func(params map[string]interface{}) interface{} {
		level, _ := strconv.Atoi(params["level"].(string))
		return d.DigitalWrite(byte(level))
	})
	d.AddCommand("AnalogRead", func(params map[string]interface{}) interface{} {
		val, err := d.AnalogRead()
		return map[string]interface{}{"val": val, "err": err}
	})
	d.AddCommand("PwmWrite", func(params map[string]interface{}) interface{} {
		level, _ := strconv.Atoi(params["level"].(string))
		return d.PwmWrite(byte(level))
	})
	d.AddCommand("ServoWrite", func(params map[string]interface{}) interface{} {
		level, _ := strconv.Atoi(params["level"].(string))
		return d.ServoWrite(byte(level))
	})
	return d
}
func (d *DirectPinDriver) Name() string { return d.name }
func (d *DirectPinDriver) Pin() string { return d.pin }
func (d *DirectPinDriver) Connection() gobot.Connection { return d.connection }
func (d *DirectPinDriver) Start() (errs []error) { return }
func (d *DirectPinDriver) Halt() (errs []error) { return }
func (d *DirectPinDriver) Off() (err error) {
	if writer, ok := d.Connection().(DigitalWriter); ok {
		return writer.DigitalWrite(d.Pin(), byte(0))
	}
	err = ErrDigitalWriteUnsupported
	return
}