Skip to content

Latest commit

 

History

History
105 lines (79 loc) · 3.4 KB

board1.md

File metadata and controls

105 lines (79 loc) · 3.4 KB
title linkTitle weight type description images tags aliases draft
Configure a <board-model> Board
<board-model>
20
docs
Configure a <board-model> board.
/icons/components/board.svg
board
components
/components/board/<board-model>/
true

{{% alert title="REQUIREMENTS" color="note" %}}

Follow the setup guide to prepare your to run viam-server before you configure your board.

{{% /alert %}}

Configure a <board-model> board to integrate an , , or board into your machine.

To test your board as you configure it, power it on. If you plan to connect hardware to the board's pins, connect the hardware while it's powered off. Then, configure the board:

{{< tabs name="Configure a Board" >}} {{% tab name="Config Builder" %}}

Navigate to the CONFIGURE tab of your machine's page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Select the board type, then select the <board-model> model. Enter a name or use the suggested name for your board and click Create.

An example configuration for a <board-model> board in the Viam app Config Builder.

Click the {} (Switch to Advanced) button in the top right of the component panel to edit your board's attributes with JSON, according to the following table.

{{% /tab %}} {{% tab name="JSON Template" %}}

{
    "analogs": [
            {
            "name": "<your-analog-reader-name>",
            "pin": "<pin-number-on-adc>",
            "spi_bus": "<your-spi-bus-index>",
            "chip_select": "<chip-select-index>",
            "average_over_ms": <int>,
            "samples_per_sec": <int>
          }
        ],
    "digital_interrupts": [
          {
            "name": "<your-digital-interrupt-name>",
            "pin": "<pin-number>"
          }
        ]
}

{{% /tab %}}
{{% tab name="JSON Example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
 "digital_interrupts": [
          {
            "name": "your-digital-interrupt-name",
            "pin": "18"
          }
        ]
}

{{% /tab %}} {{< /tabs >}}

The following attributes are available for <board-model> boards:

Name Type Required? Description
digital_interrupts object Optional Any digital interrupts's {{< glossary_tooltip term_id="pin-number" text="pin number" >}} and name. See configuration info.
analogs object Optional Attributes of any pins that can be used as Analog-to-Digital Converter (ADC) inputs. See configuration info.

Attribute configuration

Configure these attributes on your board to integrate analog-to-digital converters and digital interrupts into your machine.

analogs

{{< readfile "/static/include/components/board/board-analogs.md" >}}

digital_interrupts

{{< readfile "/static/include/components/board/board-digital-interrupts.md" >}}

Troubleshooting

{{< readfile "/static/include/components/troubleshoot/board.md" >}}

Next steps

Text & links