SkillAgentSearch skills...

Xy

:pencil2: node.js for Makeblock XY plotter v2.0

Install / Use

/learn @xy-plotter/Xy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<h1 align="center">XY</h1> <div align="center"> <a href="http://www.makeblock.com/xy-plotter-robot-kit/"> <img src="preview.png?raw=true"> </a> </div> <h3 align="center">node.js for makeblock XY plotter v2.0</h3> <div align="center"> <!-- Version --> <img alt="version" src="https://img.shields.io/badge/version-2.12.0-orange.svg?style=flat-square"/> <!-- Standard --> <a href="http://standardjs.com/"> <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard" /> </a> <!-- License --> <a href="https://raw.githubusercontent.com/arnaudjuracek/xy/master/LICENSE"> <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="License" /> </a> </div> <!-- ## Features - [./firmware](https://github.com/arnaudjuracek/xy/tree/master/firmware) : custom Arduino firmware - boundaries defined by the plotter's limit switches - pen's servo auto-sleep to prevent wear-out - faster _home_ command - [./lib](https://github.com/arnaudjuracek/xy/tree/master/lib) : node.js library - SVG support - [Processing-like API](https://processing.org/reference/) for 2D primitives (see [API](#api) below) - commands chaining for better readability -->

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

<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

API reference

Contribute

Issues

Feel free to submit any issue or request.

Pull Request

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. 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

View on GitHub
GitHub Stars25
CategoryDevelopment
Updated6mo ago
Forks6

Languages

JavaScript

Security Score

87/100

Audited on Sep 19, 2025

No findings