Skip to content

Commit

Permalink
DOCS-1441: Update I2Cs for AMS encoder (viamrobotics#2316)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre committed Dec 12, 2023
1 parent 123fda2 commit 227e81e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Binary file removed assets/components/encoder/configure-am5.png
Binary file not shown.
Binary file added assets/components/encoder/configure-ams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 3 additions & 7 deletions docs/components/encoder/ams-as5048.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ This is an absolute encoder that uses an [I<sup>2</sup>C](/components/board/#i2c
Any [motor](/components/motor/) using the `AMS-AS5048` encoder must have its `ticks_per_rotation` attribute configured as `1` because this encoder provides angular measurements directly.
{{% /alert %}}

To configure the encoder, you must first [configure an I<sup>2</sup>C bus](/components/board/#i2cs) on your [board](/components/board/).

{{< tabs name="Configure an AMS-AS5048 Encoder" >}}
{{% tab name="Config Builder" %}}

Expand All @@ -27,7 +25,7 @@ Click on the **Components** subtab and click **Create component**.
Select the `encoder` type, then select the `AMS-AS5048` model.
Enter a name for your encoder and click **Create**.

![Configuration of an AS5048 encoder in the Viam app config builder.](/components/encoder/configure-am5.png)
![Configuration of an AS5048 encoder in the Viam app config builder.](/components/encoder/configure-ams.png)

Edit and fill in the attributes as applicable.

Expand All @@ -41,10 +39,9 @@ Edit and fill in the attributes as applicable.
"type": "encoder",
"namespace": "rdk",
"attributes": {
"board": "<your-board-name>",
"connection_type": "i2c",
"i2c_attributes": {
"i2c_bus": "<your-i2c-bus-name-on-board>",
"i2c_bus": "<your-i2c-bus-index-on-board>",
"i2c_addr": <int>
}
}
Expand All @@ -59,8 +56,7 @@ The following attributes are available for `AMS-AS5048` encoders:
<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `board` | string | **Required** | The `name` of the [board](/components/board/) to which your encoder is connected. |
| `connection_type` | string | **Required** | Use `"i2c"`. |
| `i2c_attributes` | object | **Required** | The attributes to configure [I<sup>2</sup>C](/components/board/#i2cs) connection: <ul> <li> <code>i2c_bus</code>: The `name` of the [I<sup>2</sup>C bus configured](/components/board/#i2cs) on the [board](/components/board/) wired to this encoder. <br> Example: `"main"` </li> <li> <code>i2c_addr</code>: The address of the bus. <br> Example: `64` </li> </ul> |
| `i2c_attributes` | object | **Required** | The attributes to configure the [I<sup>2</sup>C](/components/board/#i2cs) connection: <ul> <li> <code>i2c_bus</code>: The index of the [I<sup>2</sup>C bus configured](/components/board/#i2cs) on the [board](/components/board/) wired to this encoder. <br> Example: `"1"` </li> <li> <code>i2c_addr</code>: The address of the bus. <br> Example: `64` </li> </ul> |

{{< readfile "/static/include/components/test-control/encoder-control.md" >}}

0 comments on commit 227e81e

Please sign in to comment.