UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

ULN200XA Class

Module: uln200xa

This module was developed on a ULN2003A Stepper Driver. It should also support the ULN2001A, ULN2002A, and ULN2004A devices, when using to drive the 28BYJ-48 unipolar stepper motor.
Vcc goes to the 5V pin on your development board and the Vm pin should be connected to an external 5V supply.
uln200xa.jpg Example driving a stepper motor

Methods

ULN200XA

(
  • stepsPerRev
  • i1
  • i2
  • i3
  • i4
)
Number

ULN200XA constructor

Parameters:

  • stepsPerRev Number

    Number of steps per full revolution

  • i1 Number

    Digital pin to use for stepper input 1

  • i2 Number

    Digital pin to use for stepper input 2

  • i3 Number

    Digital pin to use for stepper input 3

  • i4 Number

    Digital pin to use for stepper input 4

Returns:

Number:

setSpeed

(
  • speed
)

Sets the speed of the stepper motor in revolutions per minute (RPM)

Parameters:

  • speed Number

    Speed to set the motor to, in RPM

setDirection

(
  • dir
)

Sets the direction of the motor, clockwise or counterclockwise

Parameters:

  • dir ULN200XA_DIRECTION_T

    Direction to set the motor to

stepperSteps

(
  • steps
)

Steps the stepper motor a specified number of steps

Parameters:

  • steps Number

    Number of steps to move the stepper motor

release

()

Releases the stepper motor by removing power