diff --git a/assets/components/camera/configure-ultrasonic.png b/assets/components/camera/configure-ultrasonic.png index ca22858076..46c3301096 100644 Binary files a/assets/components/camera/configure-ultrasonic.png and b/assets/components/camera/configure-ultrasonic.png differ diff --git a/assets/components/sensor/ultrasonic-sensor-ui-config.png b/assets/components/sensor/ultrasonic-sensor-ui-config.png index 84e0b8a6a0..89fd8883ee 100644 Binary files a/assets/components/sensor/ultrasonic-sensor-ui-config.png and b/assets/components/sensor/ultrasonic-sensor-ui-config.png differ diff --git a/docs/components/camera/ultrasonic.md b/docs/components/camera/ultrasonic.md index ce3cf92c76..3d1a935228 100644 --- a/docs/components/camera/ultrasonic.md +++ b/docs/components/camera/ultrasonic.md @@ -27,7 +27,35 @@ Enter a name for your camera and click **Create**. ![Creation of a ultrasonic camera in the Viam app config builder.](/components/camera/configure-ultrasonic.png) -Edit and fill in the attributes as applicable. +Copy and paste the following attribute template into your camera's **Attributes** box. +Then remove and fill in the attributes as applicable to your camera, according to the table below. + +{{< tabs >}} +{{% tab name="Attributes template" %}} + +```json {class="line-numbers linkable-line-numbers"} +{ + "trigger_pin": "", + "echo_interrupt_pin": "", + "board": "", + "timeout_ms": +} +``` + +{{% /tab %}} +{{% tab name="Attributes example" %}} + +```json {class="line-numbers linkable-line-numbers"} +{ + "trigger_pin": "5", + "echo_interrupt_pin": "15", + "board": "local", + "timeout_ms": "1200" +} +``` + +{{% /tab %}} +{{< /tabs >}} {{% /tab %}} {{% tab name="JSON Template" %}} @@ -37,8 +65,9 @@ Edit and fill in the attributes as applicable. "components": [ { "name": "", - "type": "camera", "model": "ultrasonic", + "type": "camera", + "namespace": "rdk", "attributes": { "trigger_pin": "", "echo_interrupt_pin": "", @@ -58,14 +87,15 @@ Edit and fill in the attributes as applicable. { "components": [ { - "name": "your-ultrasonic-sensor", - "type": "camera", + "name": "my-ultrasonic-sensor", "model": "ultrasonic", + "type": "camera", + "namespace": "rdk", "attributes": { "trigger_pin": "5", "echo_interrupt_pin": "15", - "board": "your-board-name", - "timeout_ms": "1000" + "board": "local", + "timeout_ms": "1200" }, "depends_on": [] } diff --git a/docs/components/component/model1.md b/docs/components/component/model1.md index 26cad6d361..53ddcd58ff 100644 --- a/docs/components/component/model1.md +++ b/docs/components/component/model1.md @@ -25,6 +25,51 @@ Enter a name for your arm and click **Create**. Edit and fill in the attributes as applicable. + + {{% /tab %}} {{% tab name="JSON Template" %}} diff --git a/docs/components/sensor/ultrasonic.md b/docs/components/sensor/ultrasonic.md index c091330946..5984b215ee 100644 --- a/docs/components/sensor/ultrasonic.md +++ b/docs/components/sensor/ultrasonic.md @@ -29,7 +29,35 @@ Enter a name for your sensor and click **Create**. ![Creation of a ultrasonic sensor in the Viam app config builder.](/components/sensor/ultrasonic-sensor-ui-config.png) -Edit and fill in the attributes as applicable. +Copy and paste the following attribute template into your sensor's **Attributes** box. +Then remove and fill in the attributes as applicable to your sensor, according to the table below. + +{{< tabs >}} +{{% tab name="Attributes template" %}} + +```json {class="line-numbers linkable-line-numbers"} +{ + "trigger_pin": "", + "echo_interrupt_pin": "", + "board": "", + "timeout_ms": +} +``` + +{{% /tab %}} +{{% tab name="Attributes example" %}} + +```json {class="line-numbers linkable-line-numbers"} +{ + "trigger_pin": "5", + "echo_interrupt_pin": "15", + "board": "local", + "timeout_ms": "1200" +} +``` + +{{% /tab %}} +{{< /tabs >}} {{% /tab %}} {{% tab name="JSON Template" %}} @@ -39,8 +67,9 @@ Edit and fill in the attributes as applicable. "components": [ { "name": "", - "type": "sensor", "model": "ultrasonic", + "type": "sensor", + "namespace": "rdk", "attributes": { "trigger_pin": "", "echo_interrupt_pin": "", @@ -60,14 +89,15 @@ Edit and fill in the attributes as applicable. { "components": [ { - "name": "your-ultrasonic-sensor", - "type": "sensor", + "name": "my-ultrasonic-sensor", "model": "ultrasonic", + "type": "sensor", + "namespace": "rdk", "attributes": { "trigger_pin": "5", "echo_interrupt_pin": "15", - "board": "your-board-name", - "timeout_ms": "1000" + "board": "local", + "timeout_ms": "1200" }, "depends_on": [] } diff --git a/static/include/components/ultrasonic-attributes.md b/static/include/components/ultrasonic-attributes.md index e1f8088ef1..07c42abf35 100644 --- a/static/include/components/ultrasonic-attributes.md +++ b/static/include/components/ultrasonic-attributes.md @@ -1,7 +1,7 @@ | Attribute | Type | Inclusion | Description | | --------- | ---- | --------- | ----------- | -| `board` | string | **Required** | The `name` of the [board](/components/board/) the ultrasonic is wired to. | | `trigger_pin` | string | **Required** | The {{< glossary_tooltip term_id="pin-number" text="pin number" >}} of the [board's](/components/board/) GPIO pin that you have wired [the ultrasonic's trigger pin](https://www.sparkfun.com/products/15569) to. | | `echo_interrupt_pin` | string | **Required** | The {{< glossary_tooltip term_id="pin-number" text="pin number" >}} of the pin [the ultrasonic's echo pin](https://www.sparkfun.com/products/15569) is wired to on the board. If you have already created a [digital interrupt](/components/board/#digital_interrupts) for this pin in the [board's configuration](/components/board/), use that digital interrupt's `name` instead. | +| `board` | string | **Required** | The `name` of the [board](/components/board/) the ultrasonic is wired to. | | `timeout_ms` | int | Optional | Time to wait in milliseconds before timing out of requesting to get ultrasonic distance readings.
Default: `1000`. |