Configure a numato board
Configure a numato
board to integrate Numato GPIO Peripheral Modules into your robot:
Navigate to the Config tab of your robot’s page in the Viam app.
Click on the Components subtab and click Create component.
Select the board
type, then select the numato
model.
Enter a name for your board and click Create.
Copy and paste the following attribute template into your board’s Attributes box. Then remove and fill in the attributes as applicable to your board, according to the table below.
{
"pins": <int>
}
{
"pins": 32
}
{
"components": [
{
"name": "<your-numato-board>",
"model": "numato",
"type": "board",
"namespace": "rdk",
"attributes": {
"pins": <number>
},
"depends_on": []
}
]
}
The following attributes are available for numato
boards:
Name | Type | Inclusion | Description |
---|---|---|---|
pins | int | Required | Number of GPIO pins available on the module. |
analogs | object | Optional | Attributes of any pins that can be used as Analog-to-Digital Converter (ADC) inputs. See configuration info. |
Attribute Configuration
Configuring these attributes on your board allows you to integrate analog-to-digital converters into your robot.
analogs
An analog-to-digital converter (ADC) takes a continuous voltage input (analog signal) and converts it to an discrete integer output (digital signal).
ADCs are useful when building a robot, as they enable your board to read the analog signal output by most types of sensors and other hardware components.
To integrate an ADC into your robot, you must first physically connect the pins on your ADC to your board.
If your ADC communicates with your board using SPI, you need to wire and configure the SPI bus in addition to the analogs
.
Then, integrate analogs
into the attributes
of your board by adding the following to your board’s JSON configuration:
// "attributes": { ... ,
"analogs": [
{
"chip_select": "<chip-select-pin-number-on-board>",
"name": "<your-analog-reader-name>",
"pin": "<pin-number-on-adc>",
"spi_bus": "<your-spi-bus-name>",
"average_over_ms": <int>,
"samples_per_sec": <int>
}
]
{
"components": [
{
"model": "pi",
"name": "your-board",
"type": "board",
"attributes": {
"analogs": [
{
"chip_select": "24",
"name": "current",
"pin": "1",
"spi_bus": "main"
},
{
"chip_select": "24",
"name": "pressure",
"pin": "0",
"spi_bus": "main"
}
],
"spis": [
{
"bus_select": "0",
"name": "main"
}
]
}
}
]
}
The following properties are available for analogs
:
Name | Type | Inclusion | Description |
---|---|---|---|
name | string | Required | Your name for the analog reader. |
pin | string | Required | The pin number of the ADC’s connection pin, wired to the board. This should be labeled as the physical index of the pin on the ADC. |
chip_select | string | Required | The pin number of the board’s connection pin, wired to the ADC. |
spi_bus | string | Optional | The name of the SPI bus connecting the ADC and board. Required if your board must communicate with the ADC with the SPI protocol. |
average_over_ms | int | Optional | Duration in milliseconds over which the rolling average of the analog input should be taken. |
samples_per_sec | int | Optional | Sampling rate of the analog input in samples per second. |
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!