0.1.47 • Published 8 years ago

move-steering v0.1.47

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

0.1.46

8 years ago

0.1.45

8 years ago

0.1.44

8 years ago

0.1.43

8 years ago

0.1.42

8 years ago

0.1.41

8 years ago

0.1.40

8 years ago

0.1.39

8 years ago

0.1.38

8 years ago

0.1.37

8 years ago

0.1.36

8 years ago

0.1.35

8 years ago

0.1.34

8 years ago

0.1.33

8 years ago

0.1.31

8 years ago

0.1.30

8 years ago

0.1.29

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.26

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.19

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago