Xy
:pencil2: node.js for Makeblock XY plotter v2.0
Install / Use
/learn @xy-plotter/XyREADME
Table of contents
Installation
Node
npm install --save arnaudjuracek/xy
<sup>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 :
<sup>Note: this module has not been tested with the official makeblock firmwares</sup>
Firmware
- download and install the Arduino Software
- open ./firmware/firmware.ino
- upload it to your board, making sure you've selected the right port and board (Leonardo or Uno depending of your configuration)
- if you want to go back to the official firmware, use the mDrawBot software
<sup>Note: this firmware has not been tested with the official makeblock softwares</sup>
Server
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.
Usage
node.js
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 !')
})
more
See examples for more advanced usages.
API
Contribute
Issues
Feel free to submit any issue or request.
Pull Request
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we I review your changes
<sup>Be sure to merge the latest from "upstream" before making a pull request !</sup>
Wiki and examples
Contributions to the examples are very welcome !
Credits
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.
License
MIT.
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
