intval3/lib/intval
mmcw-dev a9e13ac2a6 Restore device state in app, set counter in webapp, 2017-10-22 19:59:38 -04:00
..
Readme.md Refactor intval library to use object. The nature of the GPIO module in use breaks references to this 2017-10-19 21:52:13 -04:00
index.js Restore device state in app, set counter in webapp, 2017-10-22 19:59:38 -04:00

Readme.md

intval

Object representing the intval3 features

Kind: global constant

intval._declarePins()

(internal function) Declares all Gpio pins that will be used

Kind: static method of intval

intval._undeclarePins()

(internal function) Undeclares all Gpio in event of uncaught error that interupts the node process

Kind: static method of intval

intval._startFwd()

Start motor in forward direction by setting correct pins in h-bridge

Kind: static method of intval

intval._startBwd()

Start motor in backward direction by setting correct pins in h-bridge

Kind: static method of intval

intval._stop()

Stop motor by setting both motor pins to 0 (LOW)

Kind: static method of intval

intval._watchMicro(err, val)

Callback for watching relese switch state changes. Using GPIO 06 on Raspberry Pi Zero W.

  1. If closed AND frame active, start timer, set state primed to true.
  2. If opened AND frame active, stop frame

Microswitch + 10K ohm resistor

  • 1 === open
  • 0 === closed

Kind: static method of intval

Param Type Description
err object Error object present if problem reading pin
val integer Current value of the pin

intval._watchRelease(err, val)

Callback for watching relese switch state changes. Using GPIO 05 on Raspberry Pi Zero W.

  1. If closed, start timer.
  2. If opened, check timer AND
  3. If press (now - intval._state.release.time) greater than minimum and less than intval._releaseSequence, start frame
  4. If press greater than intval._releaseSequence, start sequence

Button + 10K ohm resistor

  • 1 === open
  • 0 === closed

Kind: static method of intval

Param Type Description
err object Error object present if problem reading pin
val integer Current value of the pin

intval.setDir([dir])

Set the default direction of the camera.

  • forward = true
  • backward = false

Kind: static method of intval

Param Type Default Description
[dir] boolean true Direction of the camera

intval.frame([dir], [time])

Begin a single frame with set variables or defaults

Kind: static method of intval

Param Type Default Description
[dir] boolean "null" (optional) Direction of the frame
[time] integer "null" (optional) Exposure time, 0 = minimum

intval.sequence()

Start a sequence of frames, using defaults or explicit instructions

Kind: static method of intval