2017-09-17 21:54:07 +00:00
|
|
|
<a name="Intval"></a>
|
|
|
|
|
|
|
|
## Intval
|
|
|
|
Class representing the intval3 features
|
|
|
|
|
|
|
|
**Kind**: global class
|
2017-09-17 23:51:33 +00:00
|
|
|
|
|
|
|
* [Intval](#Intval)
|
|
|
|
* [._declarePins()](#Intval+_declarePins)
|
|
|
|
* [._undeclarePins()](#Intval+_undeclarePins)
|
2017-09-19 00:46:18 +00:00
|
|
|
* [._startFwd()](#Intval+_startFwd)
|
|
|
|
* [._startBwd()](#Intval+_startBwd)
|
|
|
|
* [._stop()](#Intval+_stop)
|
2017-09-19 19:06:52 +00:00
|
|
|
* [._watchMicro(err, val)](#Intval+_watchMicro)
|
|
|
|
* [._watchRelease(err, val)](#Intval+_watchRelease)
|
2017-09-19 19:20:58 +00:00
|
|
|
* [.frame([dir], [time], [delay])](#Intval+frame)
|
2017-09-17 23:51:33 +00:00
|
|
|
|
|
|
|
<a name="Intval+_declarePins"></a>
|
|
|
|
|
|
|
|
### intval._declarePins()
|
|
|
|
(internal function) Declares all Gpio pins that will be used
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
<a name="Intval+_undeclarePins"></a>
|
|
|
|
|
|
|
|
### intval._undeclarePins()
|
|
|
|
(internal function) Undeclares all Gpio in event of uncaught error
|
|
|
|
that interupts the node process
|
|
|
|
|
2017-09-19 00:46:18 +00:00
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
<a name="Intval+_startFwd"></a>
|
|
|
|
|
|
|
|
### intval._startFwd()
|
|
|
|
Start motor in forward direction by setting correct pins in h-bridge
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
<a name="Intval+_startBwd"></a>
|
|
|
|
|
|
|
|
### intval._startBwd()
|
|
|
|
Start motor in backward direction by setting correct pins in h-bridge
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
<a name="Intval+_stop"></a>
|
|
|
|
|
|
|
|
### intval._stop()
|
|
|
|
Stop motor by setting both motor pins to 0 (LOW)
|
|
|
|
|
2017-09-17 23:51:33 +00:00
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
2017-09-19 19:06:52 +00:00
|
|
|
<a name="Intval+_watchMicro"></a>
|
|
|
|
|
|
|
|
### 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.
|
|
|
|
* If closed, start timer.
|
|
|
|
* If opened, check timer AND
|
|
|
|
|
|
|
|
Microswitch + 10K ohm resistor
|
|
|
|
* 1 === open
|
|
|
|
* 0 === closed
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| err | <code>object</code> | Error object present if problem reading pin |
|
|
|
|
| val | <code>integer</code> | Current value of the pin |
|
|
|
|
|
|
|
|
<a name="Intval+_watchRelease"></a>
|
|
|
|
|
|
|
|
### 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
|
|
|
|
3) If `press` (`NOW - this._state.release.time`) greater than minimum and less than `this._releaseSequence`, start frame
|
|
|
|
4) If `press` greater than `this._releaseSequence`, start sequence
|
|
|
|
|
|
|
|
Button + 10K ohm resistor
|
|
|
|
* 1 === open
|
|
|
|
* 0 === closed
|
2017-09-19 19:06:52 +00:00
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| err | <code>object</code> | Error object present if problem reading pin |
|
|
|
|
| val | <code>integer</code> | Current value of the pin |
|
|
|
|
|
2017-09-17 23:51:33 +00:00
|
|
|
<a name="Intval+frame"></a>
|
|
|
|
|
2017-09-19 19:20:58 +00:00
|
|
|
### intval.frame([dir], [time], [delay])
|
2017-09-17 23:51:33 +00:00
|
|
|
Begin a single frame with set variables or defaults
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Intval</code>](#Intval)
|
|
|
|
|
|
|
|
| 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 |
|
|
|
|
| [delay] | <code>integer</code> | <code>"null"</code> | (optional) Delay after frame before another can be started |
|
2017-09-17 23:51:33 +00:00
|
|
|
|