2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval"></a>
|
2017-09-17 21:54:07 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
## intval
|
|
|
|
Object representing the intval3 features
|
2017-09-17 21:54:07 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: global constant
|
2017-09-17 23:51:33 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
* [intval](#intval)
|
|
|
|
* [._declarePins()](#intval._declarePins)
|
|
|
|
* [._undeclarePins()](#intval._undeclarePins)
|
|
|
|
* [._startFwd()](#intval._startFwd)
|
|
|
|
* [._startBwd()](#intval._startBwd)
|
|
|
|
* [._stop()](#intval._stop)
|
|
|
|
* [._watchMicro(err, val)](#intval._watchMicro)
|
|
|
|
* [._watchRelease(err, val)](#intval._watchRelease)
|
|
|
|
* [.setDir([dir])](#intval.setDir)
|
|
|
|
* [.frame([dir], [time])](#intval.frame)
|
|
|
|
* [.sequence()](#intval.sequence)
|
2017-09-17 23:51:33 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval._declarePins"></a>
|
2017-09-17 23:51:33 +00:00
|
|
|
|
|
|
|
### intval._declarePins()
|
|
|
|
(internal function) Declares all Gpio pins that will be used
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
|
|
|
<a name="intval._undeclarePins"></a>
|
2017-09-17 23:51:33 +00:00
|
|
|
|
|
|
|
### intval._undeclarePins()
|
|
|
|
(internal function) Undeclares all Gpio in event of uncaught error
|
|
|
|
that interupts the node process
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
|
|
|
<a name="intval._startFwd"></a>
|
2017-09-19 00:46:18 +00:00
|
|
|
|
|
|
|
### intval._startFwd()
|
|
|
|
Start motor in forward direction by setting correct pins in h-bridge
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
|
|
|
<a name="intval._startBwd"></a>
|
2017-09-19 00:46:18 +00:00
|
|
|
|
|
|
|
### intval._startBwd()
|
|
|
|
Start motor in backward direction by setting correct pins in h-bridge
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
|
|
|
<a name="intval._stop"></a>
|
2017-09-19 00:46:18 +00:00
|
|
|
|
|
|
|
### intval._stop()
|
|
|
|
Stop motor by setting both motor pins to 0 (LOW)
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
|
|
|
<a name="intval._watchMicro"></a>
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
### intval._watchMicro(err, val)
|
2017-09-19 19:20:58 +00:00
|
|
|
Callback for watching relese switch state changes.
|
|
|
|
Using GPIO 06 on Raspberry Pi Zero W.
|
2017-09-25 02:28:46 +00:00
|
|
|
|
|
|
|
1) If closed AND frame active, start timer, set state primed to `true`.
|
|
|
|
1) If opened AND frame active, stop frame
|
2017-09-19 19:20:58 +00:00
|
|
|
|
|
|
|
Microswitch + 10K ohm resistor
|
|
|
|
* 1 === open
|
|
|
|
* 0 === closed
|
2017-09-19 19:06:52 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| err | <code>object</code> | Error object present if problem reading pin |
|
|
|
|
| val | <code>integer</code> | Current value of the pin |
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval._watchRelease"></a>
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
### intval._watchRelease(err, val)
|
2017-09-19 19:20:58 +00:00
|
|
|
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
|
2017-10-20 01:52:13 +00:00
|
|
|
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
|
2017-09-19 19:20:58 +00:00
|
|
|
|
|
|
|
Button + 10K ohm resistor
|
|
|
|
* 1 === open
|
|
|
|
* 0 === closed
|
2017-09-19 19:06:52 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| err | <code>object</code> | Error object present if problem reading pin |
|
|
|
|
| val | <code>integer</code> | Current value of the pin |
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval.setDir"></a>
|
2017-09-19 19:40:42 +00:00
|
|
|
|
|
|
|
### intval.setDir([dir])
|
|
|
|
Set the default direction of the camera.
|
|
|
|
* forward = true
|
|
|
|
* backward = false
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
2017-09-19 19:40:42 +00:00
|
|
|
|
|
|
|
| Param | Type | Default | Description |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| [dir] | <code>boolean</code> | <code>true</code> | Direction of the camera |
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval.frame"></a>
|
2017-09-17 23:51:33 +00:00
|
|
|
|
2017-09-26 03:27:04 +00:00
|
|
|
### intval.frame([dir], [time])
|
2017-09-17 23:51:33 +00:00
|
|
|
Begin a single frame with set variables or defaults
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|
2017-09-17 23:51:33 +00:00
|
|
|
|
|
|
|
| Param | Type | Default | Description |
|
|
|
|
| --- | --- | --- | --- |
|
2017-09-19 19:20:58 +00:00
|
|
|
| [dir] | <code>boolean</code> | <code>"null"</code> | (optional) Direction of the frame |
|
|
|
|
| [time] | <code>integer</code> | <code>"null"</code> | (optional) Exposure time, 0 = minimum |
|
2017-09-17 23:51:33 +00:00
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
<a name="intval.sequence"></a>
|
2017-09-19 19:40:42 +00:00
|
|
|
|
|
|
|
### intval.sequence()
|
|
|
|
Start a sequence of frames, using defaults or explicit instructions
|
|
|
|
|
2017-10-20 01:52:13 +00:00
|
|
|
**Kind**: static method of [<code>intval</code>](#intval)
|