gobot.io/x/gobot/v2@v2.1.0/platforms/dragonboard/README.md (about)

     1  # DragonBoard™ 410c
     2  
     3  The [DragonBoard 410c](http://www.96boards.org/product/dragonboard410c/), a product of Arrow Electronics, is the development board based on the mid-tier Qualcomm® Snapdragon™ 410E processor. It features advanced processing power, Wi-Fi, Bluetooth connectivity, and GPS, all packed into a board the size of a credit card.
     4  
     5  ## How to Install
     6  
     7  Make sure you are using the latest Linaro Debian image. Both AArch32 and AArch64 work™ though you should stick to 64bit as OS internals may be different and aren't tested.
     8  
     9  You would normally install Go and Gobot on your workstation. Once installed, cross compile your program on your workstation, transfer the final executable to your DragonBoard and run the program on the DragonBoard itself as documented here.
    10  
    11  ```
    12  go get -d -u gobot.io/x/gobot/v2/...
    13  ```
    14  
    15  ## How to Use
    16  
    17  The pin numbering used by your Gobot program should match the way your board is labeled right on the board itself. See [here](https://www.96boards.org/db410c-getting-started/HardwareDocs/HWUserManual.md/).
    18  
    19  ```go
    20  package main
    21  
    22  import (
    23      "fmt"
    24  
    25      "gobot.io/x/gobot/v2"
    26      "gobot.io/x/gobot/v2/drivers/gpio"
    27      "gobot.io/x/gobot/v2/platforms/dragonboard"
    28  )
    29  
    30  func main() {
    31      dragonAdaptor := dragonboard.NewAdaptor()
    32      button := gpio.NewButtonDriver(dragonAdaptor, "GPIO_A")
    33  
    34      work := func() {
    35          gobot.On(button.Event("push"), func(data interface{}) {
    36              fmt.Println("button pressed")
    37          })
    38  
    39          gobot.On(button.Event("release"), func(data interface{}) {
    40              fmt.Println("button released")
    41          })
    42      }
    43  
    44      robot := gobot.NewRobot("buttonBot",
    45          []gobot.Connection{chipAdaptor},
    46          []gobot.Device{button},
    47          work,
    48      )
    49  
    50      robot.Start()
    51  }
    52  ```
    53  
    54  ## How to Connect
    55  
    56  ### Compiling
    57  
    58  Compile your Gobot program on your workstation like this:
    59  
    60  ```bash
    61  $ GOARCH=arm64 GOOS=linux go build examples/dragon_button.go
    62  ```
    63  
    64  Once you have compiled your code, you can you can upload your program and execute it on the DragonBoard from your workstation using the `scp` and `ssh` commands like this:
    65  
    66  ```bash
    67  $ scp dragon_button root@192.168.1.xx:
    68  $ ssh -t root@192.168.1.xx "./dragon_button"
    69  ```