From 904902f97f046f40812c6174b9d15a88637ac9bd Mon Sep 17 00:00:00 2001 From: Alex Ruddick Date: Sat, 8 Jul 2023 11:52:06 -0500 Subject: [PATCH] Add brushless config to EBB --- src/ebb.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ebb.ts b/src/ebb.ts index 7f12aea..f4f9f43 100644 --- a/src/ebb.ts +++ b/src/ebb.ts @@ -22,6 +22,8 @@ export class EBB { private cachedFirmwareVersion: [number, number, number] | undefined = undefined; + private brushless = false; // brushless pen servo + public constructor(port: SerialPort) { this.port = port; this.writer = this.port.writable.getWriter() @@ -156,7 +158,8 @@ export class EBB { } public setPenHeight(height: number, rate: number, delay = 0): Promise { - return this.command(`S2,${height},4,${rate},${delay}`); + const pin = this.brushless ? 5 : 4; + return this.command(`S2,${height},${pin},${rate},${delay}`); } public lowlevelMove(