Index

Microbit IOPin


The Microbit IOPin Service is a Bluetooth LE Service specific to the Microbit.

API Reference

How To Connect

The Microbit is a Bluetooth LE device, so you use the Gobot ble.ClientAdaptor to connect. You need to know the BLE address or name of the device.

   bleAdaptor := ble.NewClientAdaptor("c5:b9:46:fd:40:c0")
   ubit := microbit.NewIOPinDriver(bleAdaptor)

How To Use

Once you have connected using the ble.ClientAdaptor, you can call any of the Driver's methods, or subscribe to any of the driver's events. You can also use the IOPinDriver as a Adaptor for any of the GPIO or I2C drivers.
   ubit := microbit.NewIOPinDriver(bleAdaptor)
   button := gpio.NewButtonDriver(ubit, "0")
   led := gpio.NewLedDriver(ubit, "1")

Compatibility