Configure a BeagleBone Board
REQUIREMENTS
Follow the setup guide to prepare your BeagleBone for running viam-server
before configuring a beaglebone
board.
Configure a beaglebone
board to integrate BeagleBoard’s BeagleBone AI 64 into your machine:
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 beaglebone
model.
Enter a name or use the suggested name for your board and click Create.
Edit the attributes as applicable to your board, according to the table below.
{
"components": [
{
"name": "<your-beaglebone-board>",
"model": "beaglebone",
"type": "board",
"namespace": "rdk",
"attributes": {
"digital_interrupts": [
{
"name": "<your-digital-interrupt-name>",
"pin": "<pin-number>"
}
]
},
"depends_on": []
}
]
}
The following attributes are available for beaglebone
boards:
Name | Type | Inclusion | Description |
---|---|---|---|
digital_interrupts | object | Optional | Any digital interrupts’s pin number and name. See configuration info. |
Attribute configuration
Configuring these attributes on your board allows you to integrate digital interrupts into your machine.
digital_interrupts
Interrupts are a method of signaling precise state changes. Configuring digital interrupts to monitor GPIO pins on your board is useful when your application needs to know precisely when there is a change in GPIO value between high and low.
- When an interrupt configured on your board processes a change in the state of the GPIO pin it is configured to monitor, it calls
Tick()
to record the state change and notify any interested callbacks to “interrupt” the program. - Calling
GetGPIO()
on a GPIO pin, which you can do without configuring interrupts, is useful when you want to know a pin’s value at specific points in your program, but is less precise and convenient than using an interrupt.
Integrate digital_interrupts
into your machine in the attributes
of your board by following the Config Builder instructions, or by adding the following to your board’s JSON configuration:
On your board’s panel, click Show more, then select Add digital interrupt. Assign a name to your digital interrupt and then enter a pin number.
// "attributes": { ... ,
"digital_interrupts": [
{
"name": "<your-digital-interrupt-name>",
"pin": "<pin-number>"
}
]
{
"components": [
{
"model": "pi",
"name": "your-board",
"type": "board",
"attributes": {
"digital_interrupts": [
{
"name": "your-interrupt-1",
"pin": "15"
},
{
"name": "your-interrupt-2",
"pin": "16"
}
]
}
}
]
}
The following properties are available for digital_interrupts
:
Name | Type | Inclusion | Description |
---|---|---|---|
name | string | Required | Your name for the digital interrupt. |
pin | string | Required | The pin number of the board’s GPIO pin that you wish to configure the digital interrupt for. |
type | string | Optional | Only applies to pi model boards.
|
Test digital interrupts
Once you have configured your digital interrupts, navigate to the CONTROL tab to monitor interrupt activity. The value displayed next to each interrupt name represent the total count of interrupts triggered by the corresponding digital interrupt.
Have questions, or want to meet other people working on robots? Join our Community Discord.
If you notice any issues with the documentation, feel free to file an issue or edit this file.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!