Skip to content

Conversation

@tjanson
Copy link

@tjanson tjanson commented Oct 9, 2014

Instead of trying to establish the serial connection in the Board constructor, delegate this to a separate setup(). (API change!)
This allows the user to add listeners to the Board’s error event, which signifies that the connection could not be established. (This was already intended, but wasn't possible, as far as I can tell.)
Also displays a more intuitive error message.

Instead of trying to establish the serial connection in the Board constructor,
delegate this to a separate `setup()`. (**API change**!)
This allows the user to add listeners to the Board’s `error` event, which
signifies that the connection could not be established. (This was already
intended, but wasn't possible, as far as I can tell.)
Also displays a more intuitive error message.
`setup()` returns `this`, which allows for an easier transition from old code:

```
var board = new arduino.Board(); // old
var board = new arduino.Board().setup(); // new
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant