2019-03-18 20:51:16 +00:00
|
|
|
## Classes
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt><a href="#Arduino">Arduino</a></dt>
|
|
|
|
<dd><p>Class representing the arduino communication features</p>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
## Functions
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt><a href="#delay">delay(ms)</a> ⇒ <code>Promise</code></dt>
|
|
|
|
<dd><p>Pause the process for X milliseconds in async/await functions</p>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="Arduino"></a>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
## Arduino
|
|
|
|
Class representing the arduino communication features
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
**Kind**: global class
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
* [Arduino](#Arduino)
|
|
|
|
* [.sendAsync(device, cmd)](#Arduino+sendAsync) ⇒ <code>Promise</code>
|
|
|
|
* [.writeAsync(device, str)](#Arduino+writeAsync) ⇒ <code>Promise</code>
|
|
|
|
* [.openArduino(device)](#Arduino+openArduino) ⇒ <code>Promise</code>
|
|
|
|
* [.closeArduino(device)](#Arduino+closeArduino) ⇒ <code>Promise</code>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="Arduino+sendAsync"></a>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
### arduino.sendAsync(device, cmd) ⇒ <code>Promise</code>
|
2019-02-22 21:31:53 +00:00
|
|
|
Send a command to an Arduino using async/await
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-22 21:31:53 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after sending
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
| cmd | <code>string</code> | Single character command to send |
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="Arduino+writeAsync"></a>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
### arduino.writeAsync(device, str) ⇒ <code>Promise</code>
|
2019-02-22 21:31:53 +00:00
|
|
|
Send a string to an Arduino using async/await
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-22 21:31:53 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after sending
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
| str | <code>string</code> | String to send |
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="Arduino+openArduino"></a>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
### arduino.openArduino(device) ⇒ <code>Promise</code>
|
2019-02-22 21:31:53 +00:00
|
|
|
Connect to an Arduino using async/await
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-22 21:31:53 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after opening
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="Arduino+closeArduino"></a>
|
2019-02-22 21:31:53 +00:00
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
### arduino.closeArduino(device) ⇒ <code>Promise</code>
|
2019-02-22 21:31:53 +00:00
|
|
|
Close a connection to an Arduino using async/await
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-22 21:31:53 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after closing
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
|
2019-03-18 20:51:16 +00:00
|
|
|
<a name="delay"></a>
|
|
|
|
|
|
|
|
## delay(ms) ⇒ <code>Promise</code>
|
|
|
|
Pause the process for X milliseconds in async/await functions
|
|
|
|
|
|
|
|
**Kind**: global function
|
|
|
|
**Returns**: <code>Promise</code> - Resolves after wait
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| ms | <code>integer</code> | milliseconds |
|
|
|
|
|