2026-09-06 00:47:31 +02:00
2026-09-05 13:39:34 +02:00
2026-09-05 13:39:34 +02:00
2026-09-06 00:47:31 +02:00
2026-09-05 13:39:34 +02:00
2026-09-05 13:39:34 +02:00
2026-09-06 00:47:31 +02:00
2026-09-06 00:47:31 +02:00
2026-09-06 00:47:31 +02:00

p5-wallplotter

p5.js library for a Marlin polargraph (wall plotter) over Web Serial, plus a zigzag example.

Anleitung (Download, Linux/Windows/macOS, USB, Marlin/G-code): tutorial.md. Hardware: hardware.md. G-code: gcode.md.

p5-wallplotter/
├── tutorial.md          # setup + plotter + G-code
├── hardware.md          # motors, board, geometry
├── gcode.md             # G-code used by this setup
├── plotter.svg          # devices + signal path
├── lib/
│   ├── WallPlotter.js   # library
│   ├── README.md        # short intro + example
│   └── doc.md           # full API
├── examples/
│   ├── zickzack/        # example sketch
│   └── rechteck/        # rectangle sketch
└── sketches/            # your sketches

Run the example

Chrome or Edge. Serve over localhost (Web Serial does not work from file://).

cd p5-wallplotter
python -m http.server 8080

Open http://localhost:8080/examples/zickzack/

Press C to connect, H to set home, then Test (preview) or Plot (send G-code).

Use in a sketch

<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
<script src="../../lib/WallPlotter.js"></script>
<script src="sketch.js"></script>
let wp;

function setup() {
  createCanvas(windowWidth, windowHeight).parent('sketch-host');
  wp = new WallPlotter();
  wp.setSpeed(3000, 1500);
  wp.enableKeyInputs();
  wp.enablePlotButtons();
}

function draw() {
  background(28, 28, 32);
  wp.showInfos();
}

async function plot() {
  await drawPlot(false);
}

async function test() {
  await drawPlot(true);
}

async function drawPlot(testOnly) {
  wp.startPath();
  wp.move(-200, -200);
  wp.draw(200, -200);
  await wp.runPath(testOnly);
}

Full API: lib/doc.md.

Baud 115200. Pen servo: M280 P0 S90 up, M280 P0 S50 down. Coordinates in mm, origin at home (G92).

S
Description
No description provided
Readme
395 KiB
Languages
JavaScript 100%