2019-03-30 21:56:31 +00:00
|
|
|
<a name="Arduino"></a>
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
## Arduino
|
|
|
|
Class representing the arduino communication features
|
|
|
|
|
|
|
|
**Kind**: global class
|
|
|
|
|
|
|
|
* [Arduino](#Arduino)
|
|
|
|
* [.enumerate()](#Arduino+enumerate) ⇒ <code>Promise</code>
|
|
|
|
* [.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>
|
|
|
|
|
|
|
|
<a name="Arduino+enumerate"></a>
|
|
|
|
|
|
|
|
### arduino.enumerate() ⇒ <code>Promise</code>
|
|
|
|
Enumerate all connected devices that might be Arduinos
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
|
|
|
**Returns**: <code>Promise</code> - Resolves after enumerating
|
|
|
|
<a name="Arduino+sendAsync"></a>
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
### arduino.sendAsync(device, cmd) ⇒ <code>Promise</code>
|
2019-02-24 13:32:16 +00:00
|
|
|
Send a command to an Arduino using async/await
|
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-24 13:32:16 +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-30 21:56:31 +00:00
|
|
|
<a name="Arduino+writeAsync"></a>
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
### arduino.writeAsync(device, str) ⇒ <code>Promise</code>
|
2019-02-24 13:32:16 +00:00
|
|
|
Send a string to an Arduino using async/await
|
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-24 13:32:16 +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-30 21:56:31 +00:00
|
|
|
<a name="Arduino+openArduino"></a>
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
### arduino.openArduino(device) ⇒ <code>Promise</code>
|
2019-02-24 13:32:16 +00:00
|
|
|
Connect to an Arduino using async/await
|
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-24 13:32:16 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after opening
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
<a name="Arduino+closeArduino"></a>
|
2019-02-24 13:32:16 +00:00
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
### arduino.closeArduino(device) ⇒ <code>Promise</code>
|
2019-02-24 13:32:16 +00:00
|
|
|
Close a connection to an Arduino using async/await
|
|
|
|
|
2019-03-30 21:56:31 +00:00
|
|
|
**Kind**: instance method of [<code>Arduino</code>](#Arduino)
|
2019-02-24 13:32:16 +00:00
|
|
|
**Returns**: <code>Promise</code> - Resolves after closing
|
|
|
|
|
|
|
|
| Param | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| device | <code>string</code> | Arduino identifier |
|
|
|
|
|