@villagekit/stepper-ramp

1.0.1 • Public • Published

@villagekit/stepper-ramp

install

npm install @villagekit/stepper-ramp

example

const createRamp = require('@villagekit/stepper-ramp')

const ramp = createRamp({
  targetSpeedInStepsPerSec: 50,
  accelerationInStepsPerSecPerSec: 50,
})

const movement = ramp.movement(100)

const stepPeriodsInMicrosecs = Array.from(movement)

console.log(stepPeriodsInMicrosecs)

api

createRamp = require('@villagekit/stepper-ramp')

ramp = createRamp(options)

options is an object with shape:

  • targetSpeedInStepsPerSec: max speed in (steps / second)
  • accelerationInStepsPerSecPerSec: acceleration in (steps / second^2)

stepPeriods = ramp.movement(steps)

steps is a number.

stepPeriods is an Iterable of step periods in microsecs.

Package Sidebar

Install

npm i @villagekit/stepper-ramp

Weekly Downloads

3

Version

1.0.1

License

Apache-2.0

Unpacked Size

7.86 kB

Total Files

4

Last publish

Collaborators

  • ahdinosaur