npm install --save arnaudjuracek/xy
Note: xy
depends on node-canvas
to export image files. You may encounter some build errors at the installation if you don't have node-gyp
or python 2.7
installed. If so, you might want to check this :
Note: this module has not been tested with the official makeblock firmwares
Note: this firmware has not been tested with the official makeblock softwares
Although you can control the plotter using any node.js script on your client computer (see usage below), keeping an open serial connection for several hours can become tedious. That is why I'm using a raspberry pi as a printing server. See arnaudjuracek/xy-server.
const plotter = require('xy-plotter')()
const job = plotter.Job('my-job-name')
job.rect(10, 10, 100, 100)
.circle(10, 10, 100)
.pen_down()
.move(100, 100)
const serial = plotter.Serial('/dev/tty.wchusbserial1410')
serial.send(job).then(() => {
console.log('the job is done !')
})
See examples for more advanced usages.
Feel free to submit any issue or request.
Be sure to merge the latest from "upstream" before making a pull request !
Contributions to the examples are very welcome !
The Arduino firmware is based on Michael Fogleman's one. Thanks to the work in Python of Michael Fogleman and Anders Hoff, which helped me establish a working communication between the XY and nodejs.
MIT.