Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobrosenthal committed Jan 14, 2015
1 parent 21a38ae commit eb5b346
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 202 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
build:
@make install
@gulp
@make install
@gulp
install:
@npm install
@npm install

demo:
@google-chrome --load-and-launch-app=demo/
@google-chrome --load-and-launch-app=demo/

.PHONY: build install demo
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,41 @@ var sp = new SerialPort(port, {


sp.on("open", function() {
console.log("Connection is ready.");
//Send a string
sp.writeString("Hello robot\n");
//You can also send buffers
var buf = new Buffer("Buffers are handy", "utf8");
sp.write(buf);
console.log("Connection is ready.");
//Send a string
sp.writeString("Hello robot\n");
//You can also send buffers
var buf = new Buffer("Buffers are handy", "utf8");
sp.write(buf);
});

sp.on("error", function(err) {
console.log("Error", err);
console.log("Error", err);
});

//You can listen for data as a buffer.
sp.on("data", function(buf) {
console.log("Data", buf);
});
console.log("Data", buf);
});

//Or string encoding can be done for you
sp.on("dataString", function(string) {
console.log("String", string);
});
console.log("String", string);
});


```

You can also list the available serialports.

```js
var SerialPortLib = require("browser-serialport");

SerialPortLib.list(function(error, portsArray) {
if (!error) {
console.log("Ports available", portsArray);
}
if (!error) {
console.log("Ports available", portsArray);
}
});

```
Expand Down
Loading

0 comments on commit eb5b346

Please sign in to comment.