Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ Keller authored Jan 31, 2017
1 parent 1218e42 commit f3e2fac
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,34 @@ const ourBoard = new Ganglion({
});
```

For initializing with callback, such as to catch errors on `noble` startup:

```js
const Ganglion = require('openbci-ganglion').Ganglion;
const ourBoard = new Ganglion((error) => {
if (error) {
console.log("error", error);
} else {
console.log("no error");
}
});
```
For initializing with options and callback, such as verbose and to catch errors on `noble` startup:

```js
const Ganglion = require('openbci-ganglion').Ganglion;
const ourBoard = new Ganglion({
verbose: true
},(error) => {
if (error) {
console.log("error", error);
} else {
console.log("no error");
}
});
```


'ready' event
------------

Expand Down Expand Up @@ -176,7 +204,7 @@ See Reference Guide for a complete list of impedance tests.
---------------
### <a name="constructor"></a> Constructor:

#### <a name="init"></a> Ganglion (options)
#### <a name="init"></a> Ganglion (options, callback)

Create new instance of a Ganglion board.

Expand All @@ -201,6 +229,10 @@ Board optional configurations.

**Note, we have added support for either all lowercase OR camel case for the options, use whichever style you prefer.**

**_callback (optional)_**

Callback function to catch errors. Returns only error if an error was encountered.

### <a name="methods"></a> Methods:

#### <a name="method-accel-start"></a> .accelStart()
Expand Down

0 comments on commit f3e2fac

Please sign in to comment.