Skip to content

Commit 5e705aa

Browse files
committed
Update for API changes
1 parent 81273fe commit 5e705aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

etch-a-bits.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var drawPt = {x: 0, y: 0};
2323

2424
// Actually try to init the connection and handle the various callbacks
2525
cncserver.start({
26+
localRunner: true,
2627
success: function() {
2728
console.log('Port found, connecting...');
2829
},
@@ -37,14 +38,14 @@ cncserver.start({
3738
});
3839
},
3940
disconnect: function() {
40-
console.log("Bot disconnected!")
41+
console.log("Bot disconnected!");
4142
}
4243
});
4344

4445
function startReading(){
4546
serialPort = new SerialPort(port, {
4647
baudrate : 9600,
47-
parser: serialport.parsers.readline("\n"),
48+
parser: SerialPort.parsers.readline("\n"),
4849
disconnectedCallback: tryReconnect
4950
});
5051

@@ -137,15 +138,15 @@ function getWater(destPt) {
137138
cncserver.setHeight('draw', function(){
138139
movingPen = false;
139140
gettingWater = false;
140-
})
141+
});
141142
});
142143
});
143144
}
144145

145146

146147
// Helper function for automatically connecting the littleBits leonardo
147148
function connectLeonardo(callback) {
148-
serialport.list(function (err, ports) {
149+
SerialPort.list(function (err, ports) {
149150
for (var portID in ports){
150151
if (ports[portID].serialNumber === 'Arduino_LLC_Arduino_Leonardo') {
151152
port = ports[portID].comName;

0 commit comments

Comments
 (0)