Skip to content

CodersCafeTech/ADS1115-ADC-Viam-Module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This module implements the rdk generic API in a coderscafe:generic:ads1115 model. With this model, you can read the analog values from different channel on the ADS1115 ADC.

Requirements

Please make sure that I2C communication is enabled on the device to which the ADC is connected.

Build and Run

To use this module, follow these instructions to add a module from the Viam Registry and select the coderscafe:generic:ads1115 module.

Configure your generic

Note

Before configuring your generic, you must create a machine.

  • Navigate to the Config tab of your robot’s page in the Viam app.
  • Click on the Components subtab and click on the generic subtab.
  • Select the coderscafe:generic:ads1115 model.
  • Enter a name for your ADC component and click Create.
  • On the new component panel, copy and paste the following attribute template into your generic’s Attributes box:
{
  "address": "48",
  "busnum": 1,
  "gain":1
}
  • Save and wait for the component to finish setup

Note

For more information, see Configure a Robot.

Attributes

The following attributes are available for coderscafe:generic:ads1115 component:

Name Type Inclusion Description
address string Optional I2C address
busnum integer Optional I2C Bus Number
gain float Optional Gain Configuration (2/3, 1, 2, 4, 8, 16)

Example Configuration

{
  "address": "48",
  "busnum": 1,
  "gain":1
}

Do Command

To read the analog values from the 0th channel of the ADC, navigate to the Control tab in Viam and enter the following command in the Do Command tab.

{
"read_channel":
  {
    "channel":0
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published