gobot: gobot.io/x/gobot/platforms/microbit Index | Files

package microbit

import "gobot.io/x/gobot/platforms/microbit"

Package microbit contains the Gobot drivers for the Microbit.

For more information refer to the microbit README: https://github.com/hybridgroup/gobot/blob/master/platforms/microbit/README.md

Index

Package Files

accelerometer_driver.go button_driver.go doc.go io_pin_driver.go led_driver.go magnetometer_driver.go temperature_driver.go

Constants

const (

    // ButtonA event
    ButtonA = "buttonA"

    // ButtonB event
    ButtonB = "buttonB"
)
const (

    // Accelerometer event
    Accelerometer = "accelerometer"
)
const (

    // Magnetometer event
    Magnetometer = "magnetometer"
)
const (

    // Temperature event
    Temperature = "temperature"
)

type AccelerometerData Uses

type AccelerometerData struct {
    X   float32
    Y   float32
    Z   float32
}

type AccelerometerDriver Uses

type AccelerometerDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

AccelerometerDriver is the Gobot driver for the Microbit's built-in accelerometer

func NewAccelerometerDriver Uses

func NewAccelerometerDriver(a ble.BLEConnector) *AccelerometerDriver

NewAccelerometerDriver creates a Microbit AccelerometerDriver

func (*AccelerometerDriver) Connection Uses

func (b *AccelerometerDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*AccelerometerDriver) Halt Uses

func (b *AccelerometerDriver) Halt() (err error)

Halt stops LED driver (void)

func (*AccelerometerDriver) Name Uses

func (b *AccelerometerDriver) Name() string

Name returns the Driver Name

func (*AccelerometerDriver) SetName Uses

func (b *AccelerometerDriver) SetName(n string)

SetName sets the Driver Name

func (*AccelerometerDriver) Start Uses

func (b *AccelerometerDriver) Start() (err error)

Start tells driver to get ready to do work

type ButtonDriver Uses

type ButtonDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

ButtonDriver is the Gobot driver for the Microbit's built-in buttons

func NewButtonDriver Uses

func NewButtonDriver(a ble.BLEConnector) *ButtonDriver

NewButtonDriver creates a Microbit ButtonDriver

func (*ButtonDriver) Connection Uses

func (b *ButtonDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*ButtonDriver) Halt Uses

func (b *ButtonDriver) Halt() (err error)

Halt stops LED driver (void)

func (*ButtonDriver) Name Uses

func (b *ButtonDriver) Name() string

Name returns the Driver Name

func (*ButtonDriver) SetName Uses

func (b *ButtonDriver) SetName(n string)

SetName sets the Driver Name

func (*ButtonDriver) Start Uses

func (b *ButtonDriver) Start() (err error)

Start tells driver to get ready to do work

type IOPinDriver Uses

type IOPinDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

IOPinDriver is the Gobot driver for the Microbit's built-in digital and analog I/O

func NewIOPinDriver Uses

func NewIOPinDriver(a ble.BLEConnector) *IOPinDriver

NewIOPinDriver creates a Microbit IOPinDriver

func (*IOPinDriver) AnalogRead Uses

func (b *IOPinDriver) AnalogRead(pin string) (val int, err error)

AnalogRead reads from a pin

func (*IOPinDriver) Connection Uses

func (b *IOPinDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*IOPinDriver) DigitalRead Uses

func (b *IOPinDriver) DigitalRead(pin string) (val int, err error)

DigitalRead reads from a pin

func (*IOPinDriver) DigitalWrite Uses

func (b *IOPinDriver) DigitalWrite(pin string, level byte) (err error)

DigitalWrite writes to a pin

func (*IOPinDriver) Halt Uses

func (b *IOPinDriver) Halt() (err error)

Halt stops driver (void)

func (*IOPinDriver) Name Uses

func (b *IOPinDriver) Name() string

Name returns the Driver Name

func (*IOPinDriver) ReadAllPinData Uses

func (b *IOPinDriver) ReadAllPinData() (pins []PinData)

ReadAllPinData reads and returns the pin data for all pins

func (*IOPinDriver) ReadPinADConfig Uses

func (b *IOPinDriver) ReadPinADConfig() (config int, err error)

ReadPinADConfig reads and returns the pin A/D config mask for all pins

func (*IOPinDriver) ReadPinIOConfig Uses

func (b *IOPinDriver) ReadPinIOConfig() (config int, err error)

ReadPinIOConfig reads and returns the pin IO config mask for all pins

func (*IOPinDriver) SetName Uses

func (b *IOPinDriver) SetName(n string)

SetName sets the Driver Name

func (*IOPinDriver) Start Uses

func (b *IOPinDriver) Start() (err error)

Start tells driver to get ready to do work

func (*IOPinDriver) WritePinADConfig Uses

func (b *IOPinDriver) WritePinADConfig(config int) (err error)

WritePinADConfig writes the pin A/D config mask for all pins

func (*IOPinDriver) WritePinData Uses

func (b *IOPinDriver) WritePinData(pin string, data byte) (err error)

WritePinData writes the pin data for a single pin

func (*IOPinDriver) WritePinIOConfig Uses

func (b *IOPinDriver) WritePinIOConfig(config int) (err error)

WritePinIOConfig writes the pin I/O config mask for all pins

type LEDDriver Uses

type LEDDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

LEDDriver is the Gobot driver for the Microbit's LED array

func NewLEDDriver Uses

func NewLEDDriver(a ble.BLEConnector) *LEDDriver

NewLEDDriver creates a Microbit LEDDriver

func (*LEDDriver) Blank Uses

func (b *LEDDriver) Blank() (err error)

Blank clears the LEDs on the Microbit

func (*LEDDriver) Connection Uses

func (b *LEDDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*LEDDriver) Dimond Uses

func (b *LEDDriver) Dimond() (err error)

Dimond displays a dimond on the Microbit LEDs

func (*LEDDriver) DownLeftArrow Uses

func (b *LEDDriver) DownLeftArrow() (err error)

DownLeftArrow displays an arrow pointing down and to the left on the Microbit LEDs

func (*LEDDriver) DownRightArrow Uses

func (b *LEDDriver) DownRightArrow() (err error)

DownRightArrow displays an arrow pointing down and to the right on the Microbit LEDs

func (*LEDDriver) Halt Uses

func (b *LEDDriver) Halt() (err error)

Halt stops LED driver (void)

func (*LEDDriver) Name Uses

func (b *LEDDriver) Name() string

Name returns the Driver Name

func (*LEDDriver) ReadMatrix Uses

func (b *LEDDriver) ReadMatrix() (data []byte, err error)

ReadMatrix read the current LED matrix state

func (*LEDDriver) ReadScrollingDelay Uses

func (b *LEDDriver) ReadScrollingDelay() (delay uint16, err error)

func (*LEDDriver) SetName Uses

func (b *LEDDriver) SetName(n string)

SetName sets the Driver Name

func (*LEDDriver) Smile Uses

func (b *LEDDriver) Smile() (err error)

Smile displays a smile on the Microbit LEDs

func (*LEDDriver) Solid Uses

func (b *LEDDriver) Solid() (err error)

Solid turns on all of the Microbit LEDs

func (*LEDDriver) Start Uses

func (b *LEDDriver) Start() (err error)

Start tells driver to get ready to do work

func (*LEDDriver) UpLeftArrow Uses

func (b *LEDDriver) UpLeftArrow() (err error)

UpLeftArrow displays an arrow pointing upwards and to the left on the Microbit LEDs

func (*LEDDriver) UpRightArrow Uses

func (b *LEDDriver) UpRightArrow() (err error)

UpRightArrow displays an arrow pointing upwards and to the right on the Microbit LEDs

func (*LEDDriver) Wink Uses

func (b *LEDDriver) Wink() (err error)

Wink displays a wink on the Microbit LEDs

func (*LEDDriver) WriteMatrix Uses

func (b *LEDDriver) WriteMatrix(data []byte) (err error)

WriteMatrix writes an array of 5 bytes to set the LED matrix

func (*LEDDriver) WriteScrollingDelay Uses

func (b *LEDDriver) WriteScrollingDelay(delay uint16) (err error)

func (*LEDDriver) WriteText Uses

func (b *LEDDriver) WriteText(msg string) (err error)

WriteText writes a text message to the Microbit LED matrix

type MagnetometerData Uses

type MagnetometerData struct {
    X   float32
    Y   float32
    Z   float32
}

type MagnetometerDriver Uses

type MagnetometerDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

MagnetometerDriver is the Gobot driver for the Microbit's built-in magnetometer

func NewMagnetometerDriver Uses

func NewMagnetometerDriver(a ble.BLEConnector) *MagnetometerDriver

NewMagnetometerDriver creates a Microbit MagnetometerDriver

func (*MagnetometerDriver) Connection Uses

func (b *MagnetometerDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*MagnetometerDriver) Halt Uses

func (b *MagnetometerDriver) Halt() (err error)

Halt stops LED driver (void)

func (*MagnetometerDriver) Name Uses

func (b *MagnetometerDriver) Name() string

Name returns the Driver Name

func (*MagnetometerDriver) SetName Uses

func (b *MagnetometerDriver) SetName(n string)

SetName sets the Driver Name

func (*MagnetometerDriver) Start Uses

func (b *MagnetometerDriver) Start() (err error)

Start tells driver to get ready to do work

type PinData Uses

type PinData struct {
    // contains filtered or unexported fields
}

PinData has the read data for a specific digital pin

type RawAccelerometerData Uses

type RawAccelerometerData struct {
    X   int16
    Y   int16
    Z   int16
}

type RawMagnetometerData Uses

type RawMagnetometerData struct {
    X   int16
    Y   int16
    Z   int16
}

type TemperatureDriver Uses

type TemperatureDriver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

TemperatureDriver is the Gobot driver for the Microbit's built-in thermometer

func NewTemperatureDriver Uses

func NewTemperatureDriver(a ble.BLEConnector) *TemperatureDriver

NewTemperatureDriver creates a Microbit TemperatureDriver

func (*TemperatureDriver) Connection Uses

func (b *TemperatureDriver) Connection() gobot.Connection

Connection returns the BLE connection

func (*TemperatureDriver) Halt Uses

func (b *TemperatureDriver) Halt() (err error)

Halt stops Temperature driver (void)

func (*TemperatureDriver) Name Uses

func (b *TemperatureDriver) Name() string

Name returns the Driver Name

func (*TemperatureDriver) SetName Uses

func (b *TemperatureDriver) SetName(n string)

SetName sets the Driver Name

func (*TemperatureDriver) Start Uses

func (b *TemperatureDriver) Start() (err error)

Start tells driver to get ready to do work

Package microbit imports 6 packages (graph). Updated 2018-04-23. Refresh now. Tools for package owners.