Documentation ¶
Overview ¶
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 ¶
- Constants
- type AccelerometerData
- type AccelerometerDriver
- type ButtonDriver
- type IOPinDriver
- func (b *IOPinDriver) AnalogRead(pin string) (val int, err error)
- func (b *IOPinDriver) Connection() gobot.Connection
- func (b *IOPinDriver) DigitalRead(pin string) (val int, err error)
- func (b *IOPinDriver) DigitalWrite(pin string, level byte) (err error)
- func (b *IOPinDriver) Halt() (err error)
- func (b *IOPinDriver) Name() string
- func (b *IOPinDriver) ReadAllPinData() (pins []PinData)
- func (b *IOPinDriver) ReadPinADConfig() (config int, err error)
- func (b *IOPinDriver) ReadPinIOConfig() (config int, err error)
- func (b *IOPinDriver) SetName(n string)
- func (b *IOPinDriver) Start() (err error)
- func (b *IOPinDriver) WritePinADConfig(config int) (err error)
- func (b *IOPinDriver) WritePinData(pin string, data byte) (err error)
- func (b *IOPinDriver) WritePinIOConfig(config int) (err error)
- type LEDDriver
- func (b *LEDDriver) Blank() (err error)
- func (b *LEDDriver) Connection() gobot.Connection
- func (b *LEDDriver) Dimond() (err error)
- func (b *LEDDriver) DownLeftArrow() (err error)
- func (b *LEDDriver) DownRightArrow() (err error)
- func (b *LEDDriver) Halt() (err error)
- func (b *LEDDriver) Name() string
- func (b *LEDDriver) ReadMatrix() (data []byte, err error)
- func (b *LEDDriver) ReadScrollingDelay() (delay uint16, err error)
- func (b *LEDDriver) SetName(n string)
- func (b *LEDDriver) Smile() (err error)
- func (b *LEDDriver) Solid() (err error)
- func (b *LEDDriver) Start() (err error)
- func (b *LEDDriver) UpLeftArrow() (err error)
- func (b *LEDDriver) UpRightArrow() (err error)
- func (b *LEDDriver) Wink() (err error)
- func (b *LEDDriver) WriteMatrix(data []byte) (err error)
- func (b *LEDDriver) WriteScrollingDelay(delay uint16) (err error)
- func (b *LEDDriver) WriteText(msg string) (err error)
- type MagnetometerData
- type MagnetometerDriver
- type PinData
- type RawAccelerometerData
- type RawMagnetometerData
- type TemperatureDriver
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"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccelerometerData ¶
type AccelerometerDriver ¶
AccelerometerDriver is the Gobot driver for the Microbit's built-in accelerometer
func NewAccelerometerDriver ¶
func NewAccelerometerDriver(a ble.BLEConnector) *AccelerometerDriver
NewAccelerometerDriver creates a Microbit AccelerometerDriver
func (*AccelerometerDriver) Connection ¶
func (b *AccelerometerDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*AccelerometerDriver) Halt ¶
func (b *AccelerometerDriver) Halt() (err error)
Halt stops LED driver (void)
func (*AccelerometerDriver) Name ¶
func (b *AccelerometerDriver) Name() string
Name returns the Driver Name
func (*AccelerometerDriver) SetName ¶
func (b *AccelerometerDriver) SetName(n string)
SetName sets the Driver Name
func (*AccelerometerDriver) Start ¶
func (b *AccelerometerDriver) Start() (err error)
Start tells driver to get ready to do work
type ButtonDriver ¶
ButtonDriver is the Gobot driver for the Microbit's built-in buttons
func NewButtonDriver ¶
func NewButtonDriver(a ble.BLEConnector) *ButtonDriver
NewButtonDriver creates a Microbit ButtonDriver
func (*ButtonDriver) Connection ¶
func (b *ButtonDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*ButtonDriver) SetName ¶
func (b *ButtonDriver) SetName(n string)
SetName sets the Driver Name
func (*ButtonDriver) Start ¶
func (b *ButtonDriver) Start() (err error)
Start tells driver to get ready to do work
type IOPinDriver ¶ added in v1.5.0
IOPinDriver is the Gobot driver for the Microbit's built-in digital and analog I/O
func NewIOPinDriver ¶ added in v1.5.0
func NewIOPinDriver(a ble.BLEConnector) *IOPinDriver
NewIOPinDriver creates a Microbit IOPinDriver
func (*IOPinDriver) AnalogRead ¶ added in v1.5.0
func (b *IOPinDriver) AnalogRead(pin string) (val int, err error)
AnalogRead reads from a pin
func (*IOPinDriver) Connection ¶ added in v1.5.0
func (b *IOPinDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*IOPinDriver) DigitalRead ¶ added in v1.5.0
func (b *IOPinDriver) DigitalRead(pin string) (val int, err error)
DigitalRead reads from a pin
func (*IOPinDriver) DigitalWrite ¶ added in v1.5.0
func (b *IOPinDriver) DigitalWrite(pin string, level byte) (err error)
DigitalWrite writes to a pin
func (*IOPinDriver) Halt ¶ added in v1.5.0
func (b *IOPinDriver) Halt() (err error)
Halt stops driver (void)
func (*IOPinDriver) Name ¶ added in v1.5.0
func (b *IOPinDriver) Name() string
Name returns the Driver Name
func (*IOPinDriver) ReadAllPinData ¶ added in v1.5.0
func (b *IOPinDriver) ReadAllPinData() (pins []PinData)
ReadAllPinData reads and returns the pin data for all pins
func (*IOPinDriver) ReadPinADConfig ¶ added in v1.5.0
func (b *IOPinDriver) ReadPinADConfig() (config int, err error)
ReadPinADConfig reads and returns the pin A/D config mask for all pins
func (*IOPinDriver) ReadPinIOConfig ¶ added in v1.5.0
func (b *IOPinDriver) ReadPinIOConfig() (config int, err error)
ReadPinIOConfig reads and returns the pin IO config mask for all pins
func (*IOPinDriver) SetName ¶ added in v1.5.0
func (b *IOPinDriver) SetName(n string)
SetName sets the Driver Name
func (*IOPinDriver) Start ¶ added in v1.5.0
func (b *IOPinDriver) Start() (err error)
Start tells driver to get ready to do work
func (*IOPinDriver) WritePinADConfig ¶ added in v1.5.0
func (b *IOPinDriver) WritePinADConfig(config int) (err error)
WritePinADConfig writes the pin A/D config mask for all pins
func (*IOPinDriver) WritePinData ¶ added in v1.5.0
func (b *IOPinDriver) WritePinData(pin string, data byte) (err error)
WritePinData writes the pin data for a single pin
func (*IOPinDriver) WritePinIOConfig ¶ added in v1.5.0
func (b *IOPinDriver) WritePinIOConfig(config int) (err error)
WritePinIOConfig writes the pin I/O config mask for all pins
type LEDDriver ¶
LEDDriver is the Gobot driver for the Microbit's LED array
func NewLEDDriver ¶
func NewLEDDriver(a ble.BLEConnector) *LEDDriver
NewLEDDriver creates a Microbit LEDDriver
func (*LEDDriver) Connection ¶
func (b *LEDDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*LEDDriver) DownLeftArrow ¶
DownLeftArrow displays an arrow pointing down and to the left on the Microbit LEDs
func (*LEDDriver) DownRightArrow ¶
DownRightArrow displays an arrow pointing down and to the right on the Microbit LEDs
func (*LEDDriver) ReadMatrix ¶
ReadMatrix read the current LED matrix state
func (*LEDDriver) ReadScrollingDelay ¶
func (*LEDDriver) UpLeftArrow ¶
UpLeftArrow displays an arrow pointing upwards and to the left on the Microbit LEDs
func (*LEDDriver) UpRightArrow ¶
UpRightArrow displays an arrow pointing upwards and to the right on the Microbit LEDs
func (*LEDDriver) WriteMatrix ¶
WriteMatrix writes an array of 5 bytes to set the LED matrix
func (*LEDDriver) WriteScrollingDelay ¶
type MagnetometerData ¶
type MagnetometerDriver ¶
MagnetometerDriver is the Gobot driver for the Microbit's built-in magnetometer
func NewMagnetometerDriver ¶
func NewMagnetometerDriver(a ble.BLEConnector) *MagnetometerDriver
NewMagnetometerDriver creates a Microbit MagnetometerDriver
func (*MagnetometerDriver) Connection ¶
func (b *MagnetometerDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*MagnetometerDriver) Halt ¶
func (b *MagnetometerDriver) Halt() (err error)
Halt stops LED driver (void)
func (*MagnetometerDriver) Name ¶
func (b *MagnetometerDriver) Name() string
Name returns the Driver Name
func (*MagnetometerDriver) SetName ¶
func (b *MagnetometerDriver) SetName(n string)
SetName sets the Driver Name
func (*MagnetometerDriver) Start ¶
func (b *MagnetometerDriver) Start() (err error)
Start tells driver to get ready to do work
type PinData ¶ added in v1.5.0
type PinData struct {
// contains filtered or unexported fields
}
PinData has the read data for a specific digital pin
type RawAccelerometerData ¶
type RawMagnetometerData ¶
type TemperatureDriver ¶
TemperatureDriver is the Gobot driver for the Microbit's built-in thermometer
func NewTemperatureDriver ¶
func NewTemperatureDriver(a ble.BLEConnector) *TemperatureDriver
NewTemperatureDriver creates a Microbit TemperatureDriver
func (*TemperatureDriver) Connection ¶
func (b *TemperatureDriver) Connection() gobot.Connection
Connection returns the BLE connection
func (*TemperatureDriver) Halt ¶
func (b *TemperatureDriver) Halt() (err error)
Halt stops Temperature driver (void)
func (*TemperatureDriver) Name ¶
func (b *TemperatureDriver) Name() string
Name returns the Driver Name
func (*TemperatureDriver) SetName ¶
func (b *TemperatureDriver) SetName(n string)
SetName sets the Driver Name
func (*TemperatureDriver) Start ¶
func (b *TemperatureDriver) Start() (err error)
Start tells driver to get ready to do work