live plot example and screenToPlot helper

This commit is contained in:
Martin Fuchs
2026-09-09 12:06:56 +02:00
parent c129222b78
commit ce288bd35d
6 changed files with 198 additions and 2 deletions
+10 -2
View File
@@ -184,13 +184,21 @@ Write one G-code line and wait for Marlin `ok`.
Send pen G-code and wait the pen delay. By default, no-op if already in that state. Pass `true` to always send (used by `P` and on connect) so you can test the configured angles.
### `screenToPlot(px, py, options?)`
Convert canvas pixel coordinates to plot coordinates in mm.
- `px`, `py` (number): screen/canvas pixel coordinates.
- `options.clamp` (boolean, default `true`): clamp result to bounds.
- `options.useDisplayBounds` (boolean, default `false`): use current display bounds (preview when disconnected) instead of machine bounds.
### `moveTo(x, y)`
Pen up, travel to `(x, y)` mm immediately (not queued). Requires home.
Pen up, travel to `(x, y)` mm immediately (not queued), then wait for motion completion (`M400`). Requires home.
### `drawTo(x, y)`
Pen down, draw to `(x, y)` mm immediately. Requires home.
Pen down, draw to `(x, y)` mm immediately, then wait for motion completion (`M400`). Requires home.
### `goToZero()`