Skip to content

viam-modules/uln2003

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This uln2003 module implements a ULN2003, used for low-current and low-precision applications using the rdk:component:motor API. It supports full, half, and quarter stepping with 4096 steps in a rotation in full-step mode.

Configure your 28byj-48 motor

Note

Before configuring your motor, you must create a machine.

Navigate to the CONFIGURE tab of your machine in the Viam app. Add motor / uln2003:28byj-48 to your machine.

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

{
  "board": "<your-board-name>",
  "pins": {
    "in1": "<pin-number>",
    "in2": "<pin-number>",
    "in3": "<pin-number>",
    "in4": "<pin-number>"
  },
  "ticks_per_rotation": <int>
}

Attributes

The following attributes are available for viam:uln2003:28byj-48 motors:

Attribute Type Required? Description
board string Required name of the board the motor driver is wired to.
pins object Required A JSON object containing the pin numbers the in1, in2, in3, and in4 pins of the motor driver are wired to on the board.
ticks_per_rotation int Required Number of full steps in a rotation. The motor takes 5.625*(1/64)° per step. One full rotation (360°) is 4096 steps.

Refer to your motor and motor driver data sheets for specifics.

Example configuration

viam:uln2003:28byj-48

  {
      "name": "<your-uln2003-28byj-48-motor-name>",
      "model": "viam:uln2003:28byj-48",
      "type": "motor",
      "namespace": "rdk",
      "attributes": {
        "board": "example-board",
        "pins": {
          "in1": "11",
          "in2": "12",
          "in3": "13",
          "in4": "15"
        },
        "ticks_per_rotation": 4096
      }
      "depends_on": []
  }

Next Steps

  • To test your motor, expand the TEST section of its configuration pane or go to the CONTROL tab.
  • To write code against your motor, use one of the available SDKs.
  • To view examples using a motor component, explore these tutorials.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •