0.1.47 • Published 9 years ago

move-steering v0.1.47

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

move-steering

NPM version Code style

to make motors move at the same time

Installation

$ npm install move-steering

Usage

var MoveSteering = require('move-steering')

MoveSteering('b', 'c').degrees(360, 300, 0) // move straight for 1 motor rotation
MoveSteering().timed(2000, 300, 100) // turn right for 2 seconds

API

MoveSteering(leftPort, rightPort)

  • leftPort - port letter of the left motor. defaults to 'b'.
  • rightPort - port letter of the right motor. defaults to 'c'.

Returns: a move steering instance that controls two motors

.forever(speed, turn, opts)

Run both motors until they receive a stop command.

  • speed - speed at which to run the motors
  • turn - number between -100 and 100 to denote amount of turning. -100 is maximum left turn. 0 is straight. 100 is maximum right turn.
  • opts - an object of optional parameters

.degrees(degrees, speed, turn)

Run both motors for a number of degrees with the ability to turn.

  • degrees - number of degrees for the motor to spin
  • speed - speed at which to run the motors
  • turn - number between -100 and 100 to denote amount of turning. -100 is maximum left turn. 0 is straight. 100 is maximum right turn.

.rotations(rotations, speed, turn)

Run both motors with a number of degrees the ability to turn.

  • rotations - number of rotations for the motor to spin
  • speed - speed at which to run the motors
  • turn - number between -100 and 100 to denote amount of turning. -100 is maximum left turn. 0 is straight. 100 is maximum right turn.

.timed(time, speed, turn)

Run both motor for a specified amount of time.

  • time - time in milliseconds
  • speed - speed at which to run the motors
  • turn - number between -100 and 100 to denote amount of turning. -100 is maximum left turn. 0 is straight. 100 is maximum right turn.

.stop()

Stop both motors.

.reset()

Reset both motors.

License

MIT

0.1.47

9 years ago

0.1.46

9 years ago

0.1.45

9 years ago

0.1.44

9 years ago

0.1.43

9 years ago

0.1.42

9 years ago

0.1.41

9 years ago

0.1.40

9 years ago

0.1.39

9 years ago

0.1.38

9 years ago

0.1.37

9 years ago

0.1.36

9 years ago

0.1.35

10 years ago

0.1.34

10 years ago

0.1.33

10 years ago

0.1.31

10 years ago

0.1.30

10 years ago

0.1.29

10 years ago

0.1.28

10 years ago

0.1.27

10 years ago

0.1.26

10 years ago

0.1.25

10 years ago

0.1.24

10 years ago

0.1.23

10 years ago

0.1.22

10 years ago

0.1.21

10 years ago

0.1.20

10 years ago

0.1.19

10 years ago

0.1.18

10 years ago

0.1.17

10 years ago

0.1.16

10 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago