Skip to content

ev3-js/motor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

motor

NPM version Code style

Motor device for ev3.

Installation

$ npm install ev3-js-motor

Usage

var Motor = require('ev3-js-motor')
Motor('a').degrees(120, {
  speed: 300,
  braking: 'coast'
})

API

Motor(port)

  • path - port in which the motor is connected

Returns: a motor device instance

.forever(speed)

Run motor until stopped.

  • speed - speed at which to run motor

.degrees(degrees, opts)

Run motor for a number of degrees.

  • degrees - number of degrees to turn the motor
  • opts - object of optional parameters

.rotations(rotations, opts)

Run motor for a number of rotations.

  • rotations - number of rotations to turn the motor
  • opts - object of optional parameters

.timed(time, opts)

Run motor for a specified amount of time.

  • time - time in milliseconds
  • opts - object of optional parameters

.runToAbsPos(position, opts)

Run motor until a specified motor position.

  • speed - speed at which to run motor
  • position - desired motor position

.stop()

Stop motor.

.reset()

Reset the position of the motor.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published