Help us shape the future of Go! Take the 2026 Go Developer Survey

ams

command module
v0.0.0-...-c43cc83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

ams module

This ams module implements an ams as5048 encoder, an absolute encoder that uses an I2C or SPI interface to connect, using the rdk:component:encoder API.

[!NOTE] Before configuring your encoder, you must create a machine.

Navigate to the CONFIGURE tab of your machine in the Viam app. Add encoder / ams:as5048 to your machine.

Configure your as5048 encoder

On the new component panel, copy and paste the following attribute template into your encoder's attributes field:

{
  "connection_type": "i2c",
  "i2c_attributes": {
    "i2c_bus": "<your-i2c-bus-index-on-board>",
    "i2c_addr": <int>
  }
}

IMPORTANT Any motor using the AMS-AS5048 encoder must have its ticks_per_rotation attribute configured as 1 because this encoder provides angular measurements directly.

Attributes

The following attributes are available for viam:ams:as5048 encoders:

Attribute Type Required? Description
connection_type string Required Use "i2c".
i2c_attributes object Required The attributes to configure the I2C connection: i2c_bus and i2c_addr
i2c_bus object Required The index of the I2C bus on the board wired to this encoder. Example: "1"
i2c_addr object Required The address of the bus. Example: 64
Example configuration
  {
    "connection_type": "i2c",
    "i2c_attributes": {
      "i2c_bus": "1",
      "i2c_addr": 64
    }
  }
Next Steps
  • To test your encoder, expand the TEST section of its configuration pane or go to the CONTROL tab.
  • To write code against your encoder, use one of the available SDKs.
  • To view examples using a encoder component, explore these tutorials.

Documentation

Overview

package main is a module with raspberry pi board component.

Directories

Path Synopsis
Package as5048 implements the AMS_AS5048 encoder
Package as5048 implements the AMS_AS5048 encoder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL