Skip to content

Commit

Permalink
microbit: explain how to use IOPinDriver with gpio and aio drivers
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Apr 15, 2017
1 parent 9a2cc0b commit d7f00b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions platforms/microbit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func main() {

### Using Microbit with GPIO and AIO Drivers

The IOPinDriver is both a Driver, as well as an Adaptor. This means you can use it as the Adaptor for any gpio or aio Driver. In this example, we are just using the normal `gpio.ButtonDriver` and `gpio.LedDriver`:
The IOPinDriver is a special kind of Driver. It supports the DigitalReader, DigitalWriter, and AnalogReader interfaces.

This means you can use it with any gpio or aio Driver. In this example, we are using the normal `gpio.ButtonDriver` and `gpio.LedDriver`:

```go
package main
Expand Down Expand Up @@ -106,7 +108,7 @@ func main() {
}

robot := gobot.NewRobot("buttonBot",
[]gobot.Connection{bleAdaptor, ubit},
[]gobot.Connection{bleAdaptor},
[]gobot.Device{ubit, button, led},
work,
)
Expand Down

0 comments on commit d7f00b1

Please sign in to comment.