0.1.4 • Published 8 years ago

ev3-js-wait v0.1.4

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

wait

NPM version Code style

wait block for use with running the motor forever

Installation

$ npm install ev3-js-wait

Usage

var wait = require('ev3-js-wait')
var TouchSensor = require('ev3-js-touch-sensor')
var MoveSteering = require('move-steering')

// Move forever
MoveSteering.forever(300)

// Wait for the touch sensor to activate
wait(function () {
  return TouchSensor(3).value === 1
})

// Turn the robot to the right
MoveSteering.degrees(360, 300, 100)

API

wait(fn)

  • fn - function that returns a conditional

License

MIT