analogValueGet

Read all analog input values. See https://evil-mad.github.io/EggBot/ebb.html#A.

analogValueGet(): Promise<any>
Returns
Promise<any>: Resolves with an object whose keys are the analog. channel numbers and whose values are the analog values (0-1023).

analogConfigure

Configure an analog input channel. See https://evil-mad.github.io/EggBot/ebb.html#AC.

analogConfigure(channel: number, enabled: boolean): Promise<void>
Parameters
channel (number) The analog channel number (0-15).
enabled (boolean) Whether the channel should be enabled.
Returns
Promise<void>: Resolves after the command has been acknowledged.

enterBootloader

Enter bootloader mode. See https://evil-mad.github.io/EggBot/ebb.html#BL.

enterBootloader(): Promise<void>
Returns
Promise<void>: Resolves after the EBB has been disconnected.

configurePinDirections

Configure all pins as inputs or outputs at once. See https://evil-mad.github.io/EggBot/ebb.html#C and the PIC18F46J50 datasheet. A pin is an input if the corresponding bit in the TRIS register is 1.

configurePinDirections(portA: number, portB: number, portC: number, portD: number, portE: number)
Parameters
portA (number) The 8-bit TRISA value to set.
portB (number) The 8-bit TRISB value to set.
portC (number) The 8-bit TRISC value to set.
portD (number) The 8-bit TRISD value to set.
portE (number) The 8-bit TRISE value to set.

clearStepPosition

Zero the motor step positions. See https://evil-mad.github.io/EggBot/ebb.html#CS.

clearStepPosition(): Promise<void>
Returns
Promise<void>: Resolves after the command has been acknowledged.

configureUserOptions

Configure user interface options. See https://evil-mad.github.io/EggBot/ebb.html#CU.

configureUserOptions(enableOkResponse: boolean?, enableParameterLimitChecking: boolean?, enableFifoLedIndicator: boolean?)
Parameters
enableOkResponse (boolean? = true) Whether to send an "OK" response to each command.
enableParameterLimitChecking (boolean? = true) Whether to check parameter limits.
enableFifoLedIndicator (boolean? = false) Whether to light the LED when the FIFO is empty.

enableMotors

Enable or disable stepper motors and set step mode. See https://evil-mad.github.io/EggBot/ebb.html#EM.

enableMotors(m1Mode: number, m2Mode: number): Promise<void>
Parameters
m1Mode (number) Step mode for motor 1.
m2Mode (number) Step mode for motor 2.
Returns
Promise<void>: Resolves after the command has been acknowledged.

emergencyStop

Aborts any in-progress motor move and deletes any motor move commands from the FIFO. See https://evil-mad.github.io/EggBot/ebb.html#ES.

emergencyStop(disableMotors: boolean?): Promise<EStopInfo>
Parameters
disableMotors (boolean?) Whether to de-energize the motors.
Returns
Promise<EStopInfo>: Resolves after the command has been acknowledged.

absoluteMove

Move to an absolute position relative to home. Only meant for "utility" moves rather than smooth/fast motion. Read the current global position using QS (@see queryStepPosition) and clear it using CS (@see clearStepPosition). If no destination position is specified, then the move is towards the Home position (0, 0). See https://evil-mad.github.io/EggBot/ebb.html#HM.

absoluteMove(stepFrequency: number, position1: number?, position2: number?)
Parameters
stepFrequency (number) The step frequency in Hz (2-25000).
position1 (number? = 0) The absolute position for motor 1 (+/-4,294,967).
position2 (number? = 0) The absolute position for motor 2 (+/-4,294,967).

getInput

Read every byte-wide PORTx register (A-E) and return the values. See https://evil-mad.github.io/EggBot/ebb.html#I.

getInput(): Promise<Array<number>>
Returns
Promise<Array<number>>: Resolves with an array of the port values.

lowLevelMove

Low-level, step-limited move command. Causes one or both motors to move for a given number of steps, and allows the option of applying a constant acceleration to one or both motors during their movement. The motion terminates for each axis when the required number of steps have been made, and the command is complete when the both motors have reached their targets. See https://evil-mad.github.io/EggBot/ebb.html#LM.

lowLevelMove(m1Rate: number, m1Steps: number, m1Accel: number, m1Clear: boolean, m2Rate: number, m2Steps: number, m2Accel: number, m2Clear: boolean): Promise<void>
Parameters
m1Rate (number) Step rate for motor 1 (0 to 2^31-1). Added to the motor 1 accumulator at each control interval (40us).
m1Steps (number) Number of steps for motor 1 (-2^31 to 2^31-1).
m1Accel (number) Added to the step rate at each control interval (40us).
m1Clear (boolean) Zeroes the motor 1 accumulator before starting if true.
m2Rate (number) Step rate for motor 2 (0 to 2^31-1). Added to the motor 2 accumulator at each control interval (40us).
m2Steps (number) Number of steps for motor 2 (-2^31 to 2^31-1).
m2Accel (number) Added to the step rate at each control interval (40us).
m2Clear (boolean) Zeroes the motor 2 accumulator before starting if true.
Returns
Promise<void>: Resolves after the command has been acknowledged.

lowLevelMoveTimeLimited

Low-level, time-limited move command. causes one or both motors to move for a given duration of time, and allows the option of applying a constant acceleration to one or both motors during their movement. The motion terminates for each axis when the required number of time intervals has elapsed. See https://evil-mad.github.io/EggBot/ebb.html#LT.

lowLevelMoveTimeLimited(intervals: number, m1Rate: number, m1Accel: number, m1Clear: boolean, m2Rate: number, m2Accel: number, m2Clear: boolean): Promise<void>
Parameters
intervals (number) Number of 40us time intervals for the motors to move (0 to 2^31-1).
m1Rate (number) Step rate for motor 1 (-(2^31-1) to 2^31-1). Absolute value is added to the motor 1 accumulator at each control interval (40us). Sign determines direction.
m1Accel (number) Added to the step rate at each control interval (40us). -2^31 to 2^31-1.
m1Clear (boolean) Zeroes the motor 1 accumulator before starting if true.
m2Rate (number) Step rate for motor 2 (-(2^31-1) to 2^31-1). Absolute value is added to the motor 2 accumulator at each control interval (40us). Sign determines direction.
m2Accel (number) Added to the step rate at each control interval (40us). -2^31 to 2^31-1.
m2Clear (boolean) Zeroes the motor 2 accumulator before starting if true.
Returns
Promise<void>: Resolves after the command has been acknowledged.

memoryRead

Read the byte value at a memory address. See https://evil-mad.github.io/EggBot/ebb.html#MR.

memoryRead(address: number): Promise<number>
Parameters
address (number) Address to read (0 to 4095).
Returns
Promise<number>: Resolves with the byte value at the given address.

memoryWrite

Write a byte value at the given memory address. See https://evil-mad.github.io/EggBot/ebb.html#MW.

memoryWrite(address: number, value: number): Promise<void>
Parameters
address (number) Address to write (0 to 4095).
value (number) Byte value to write (0 to 255).
Returns
Promise<void>: Resolves after the command has been acknowledged.

nodeCountDecrement

Decrement the node counter by 1. See https://evil-mad.github.io/EggBot/ebb.html#ND.

nodeCountDecrement(): Promise<void>
Returns
Promise<void>: Resolves after the command has been acknowledged.

nodeCountIncrement

Increment the node counter by 1. See https://evil-mad.github.io/EggBot/ebb.html#NI.

nodeCountIncrement(): Promise<void>
Returns
Promise<void>: Resolves after the command has been acknowledged.

setOutputs

Output digital values to the pins of the microcontroller. The pins must have been configured as digital outputs. See https://evil-mad.github.io/EggBot/ebb.html#O.

setOutputs(portA: number, portB: number, portC: number, portD: number, portE: number): Promise<void>
Parameters
portA (number) Value to write to port A (0 to 255).
portB (number) Value to write to port B (0 to 255).
portC (number) Value to write to port C (0 to 255).
portD (number) Value to write to port D (0 to 255).
portE (number) Value to write to port E (0 to 255).
Returns
Promise<void>: Resolves after the command has been acknowledged.

pulseConfigure

Configures the pulse generator parameters. See https://evil-mad.github.io/EggBot/ebb.html#PC.

pulseConfigure(duration0: number, period0: number, duration1: number, period1: number, duration2: number, period2: number, duration3: number, period3: number): Promise<void>
Parameters
duration0 (number) Duration in milliseconds that pulse 0 will be high (0 to 65535).
period0 (number) Period for pulse 0 in milliseconds (0 to 65535).
duration1 (number) Duration in milliseconds that pulse 1 will be high (0 to 65535).
period1 (number) Period for pulse 1 in milliseconds (0 to 65535).
duration2 (number) Duration in milliseconds that pulse 2 will be high (0 to 65535).
period2 (number) Period for pulse 2 in milliseconds (0 to 65535).
duration3 (number) Duration in milliseconds that pulse 3 will be high (0 to 65535).
period3 (number) Period for pulse 3 in milliseconds (0 to 65535).
Returns
Promise<void>: Resolves after the command has been acknowledged.

setPinDirection

Set the direction of a pin. See https://evil-mad.github.io/EggBot/ebb.html#PD.

setPinDirection(portLetter: string, pinIndex: number, isOutput: boolean): Promise<void>
Parameters
portLetter (string) Letter of the processor port the pin belongs to. A, B, C, D, or E.
pinIndex (number) Index of the pin to use. 0 to 7.
isOutput (boolean) Set pin to output if true, input if false.
Returns
Promise<void>: Resolves after the command has been acknowledged.

pulseGo

Start or stop pulse generation. See https://evil-mad.github.io/EggBot/ebb.html#PG.

pulseGo(enabled: boolean): Promise<void>
Parameters
enabled (boolean) Start pulse generation if true, stop if false.
Returns
Promise<void>: Resolves after the command has been acknowledged.

pinInput

Read the state of a pin. See https://evil-mad.github.io/EggBot/ebb.html#PI.

pinInput(portLetter: string, pinIndex: number): Promise<boolean>
Parameters
portLetter (string) Letter of the processor port the pin belongs to. A, B, C, D, or E.
pinIndex (number) Index of the pin to use. 0 to 7.
Returns
Promise<boolean>: Resolves with true if the pin is high, false if low.

pinOutput

Write a digital value to a pin.

pinOutput(portLetter: string, pinIndex: number, setPinHigh: boolean): Promise<void>
Parameters
portLetter (string) Letter of the processor port the pin belongs to. A, B, C, D, or E.
pinIndex (number) Index of the pin to use. 0 to 7.
setPinHigh (boolean) Set pin high if true, low if false.
Returns
Promise<void>:

queryButton

Query whether the button was pressed since the last time this command was called. See https://evil-mad.github.io/EggBot/ebb.html#QB.

queryButton(): Promise<boolean>
Returns
Promise<boolean>: Resolves with true if the button was pressed, false if not.

queryCurrent

Read the max current setting and the power voltage. See https://evil-mad.github.io/EggBot/ebb.html#QC.

queryCurrent(oldBoard: boolean): Promise<{maxCurrent: number, powerVoltage: number}>
Parameters
oldBoard (boolean = false) Set to true if using an EBB board v2.2 or older.
Returns
Promise<{maxCurrent: number, powerVoltage: number}>: Resolves with the max current setting and the power voltage.

queryMotorConfig

Query the current motor configuration. Firmware versions v2.8.0 and newer. See https://evil-mad.github.io/EggBot/ebb.html#QE.

queryMotorConfig(): Promise<Array<number>>
Returns
Promise<Array<number>>: Resolves with an array of step modes for each motor.

queryGeneral

Query the general status. See https://evil-mad.github.io/EggBot/ebb.html#QG.

queryGeneral(): Promise<GeneralStatus>
Returns
Promise<GeneralStatus>: Resolves with the general status.

queryLayer

Query the current value of the layer variable. See https://evil-mad.github.io/EggBot/ebb.html#QL.

queryLayer(): Promise<number>
Returns
Promise<number>: Resolves with the value of the current layer variable.

queryMotors

Query the status of the motors and motion FIFO. See https://evil-mad.github.io/EggBot/ebb.html#QM.

queryMotors(): MotorStatus
Returns
MotorStatus:

queryPen

Query the pen status. See https://evil-mad.github.io/EggBot/ebb.html#QP.

queryPen(): Promise<boolean>
Returns
Promise<boolean>: Whether the pen is down (true) or down (true).

queryServoPower

Query the servo power status. See https://evil-mad.github.io/EggBot/ebb.html#QR.

queryServoPower(): Promise<boolean>
Returns
Promise<boolean>: True if the servo is receiving power.

queryStepPosition

Query the step position of the motors. See https://evil-mad.github.io/EggBot/ebb.html#QS.

queryStepPosition(): Promise<Array<number>>
Returns
Promise<Array<number>>: The step position of the motors.

queryNickname

Query the EBB's nickname. See https://evil-mad.github.io/EggBot/ebb.html#QT.

queryNickname(): Promise<string>
Returns
Promise<string>: The nickname.

reboot

Reboot the EBB. See https://evil-mad.github.io/EggBot/ebb.html#RB.

reboot(): Promise<void>
Returns
Promise<void>: Resolves when the EBB has been disconnected.

reset

Reset the EBB.

reset(): Promise<void>
Returns
Promise<void>: Resolves when the EBB has been reset.

servoOutput

Control the RC servo output system. See https://evil-mad.github.io/EggBot/ebb.html#S2.

servoOutput(position: number, pinIndex: number, rate: number, delay: number): Promise<void>
Parameters
position (number) The "on time" of the signal, in units of 1/12e6 seconds.
pinIndex (number) The pin index to use.
rate (number) Slew rate between last setting and the new one. 1/12e3 second per 24 ms.
delay (number) Delay the next command in the motion queue by this many milliseconds.
Returns
Promise<void>: Resolves when the command has been acknowledged.

stepperAndServoModeConfigure

Configure stepper and servo modes. See https://evil-mad.github.io/EggBot/ebb.html#SC.

stepperAndServoModeConfigure(paramIndex: number, paramValue: number): Promise<void>
Parameters
paramIndex (number) The parameter index to set.
paramValue (number) The value to set.
Returns
Promise<void>: Resolves when the command has been acknowledged.

setEngraver

Enable or disable and configure the engraver. See https://evil-mad.github.io/EggBot/ebb.html#SE.

setEngraver(enableEngraver: boolean, power: number, useMotionQueue: boolean): Promise<void>
Parameters
enableEngraver (boolean) Whether to enable the engraver.
power (number) The power to use (0-1023).
useMotionQueue (boolean) Whether to use the motion queue.
Returns
Promise<void>: Resolves when the command has been acknowledged.

setLayer

Set the value of the layer variable.

setLayer(layerValue: number): Promise<void>
Parameters
layerValue (number) The value to set.
Returns
Promise<void>: Resolves when the command has been acknowledged.

stepperMove

Move the stepper motors.

stepperMove(duration: number, m1Steps: number, m2Steps: number): Promise<void>
Parameters
duration (number) The duration of the move in milliseconds (1 to 2^24-1).
m1Steps (number) The number of steps to move motor 1 (-(2^24-1) to 2^24-1).
m2Steps (number) The number of steps to move motor 2 (-(2^24-1) to 2^24-1).
Returns
Promise<void>: Resolves when the command has been acknowledged.

setNodeCount

Set the node count. See https://evil-mad.github.io/EggBot/ebb.html#SN.

setNodeCount(value: number): Promise<void>
Parameters
value (number) The node count (0-2^32).
Returns
Promise<void>: Resolves when the node count has been set.

setPenState

Set the pen state. See https://evil-mad.github.io/EggBot/ebb.html#SP.

setPenState(penDown: boolean, duration: number?, portBPin: number?): Promise<void>
Parameters
penDown (boolean) Whether the pen should be down (true) or up (false).
duration (number?) Duration in milliseconds
portBPin (number?) Port B pin number (0-7)
Returns
Promise<void>: Resolves when the command has been acknowledged.

setServoPowerTimeout

Set the servo power timeout. See https://evil-mad.github.io/EggBot/ebb.html#SR.

setServoPowerTimeout(duration: number, setPowerOn: boolean): Promise<void>
Parameters
duration (number) Duration in milliseconds (0-2^32).
setPowerOn (boolean) Whether to set the power on (true) or off (false).
Returns
Promise<void>:

setNickname

Set this EBB's nickname. See https://evil-mad.github.io/EggBot/ebb.html#ST.

setNickname(nickname: string): Promise<void>
Parameters
nickname (string)
Returns
Promise<void>: Resolves when the nickname has been set.

timedRead

Turn on or off timed readings. See https://evil-mad.github.io/EggBot/ebb.html#T.

timedRead(duration: number, digitalMode: boolean): Promise<void>
Parameters
duration (number) Duration in milliseconds (1-2^16).
digitalMode (boolean) Whether to use digital mode (true) or analog mode (false).
Returns
Promise<void>: Resolves when the command has been acknowledged.

togglePen

Toggle the state of the pen up or down. See https://evil-mad.github.io/EggBot/ebb.html#TP.

togglePen(duration: number?): Promise<void>
Parameters
duration (number?) Duration in milliseconds
Returns
Promise<void>: Resolves when the pen state has been toggled.

queryNodeCount

Query the node count. See https://evil-mad.github.io/EggBot/ebb.html#QN.

queryNodeCount(): Promise<number>
Returns
Promise<number>: Resolves to the node count.

queryVersion

Query the EBB version. See https://evil-mad.github.io/EggBot/ebb.html#V.

queryVersion(): Promise<string>
Returns
Promise<string>: Resolves to the EBB version string.

stepperMoveMixedAxis

Stepper move, for mixed-axis geometries. See https://evil-mad.github.io/EggBot/ebb.html#XM.

stepperMoveMixedAxis(durationMs: number, stepsA: number, stepsB: number): Promise<void>
Parameters
durationMs (number) Duration of the move in milliseconds.
stepsA (number)
stepsB (number)
Returns
Promise<void>: Resolves when the command is acknowledged.

EStopInfo

EStopInfo

Type: Object

Properties
interrupted (boolean) : Whether the command was interrupted.
fifoSteps (Array<number>) : Number of steps remaining in the FIFO for each motor.
stepsRemaining (Array<number>) : Number of steps remaining in the current command for each motor.

GeneralStatus

GeneralStatus

Type: Object

Properties
pinRB5 (boolean) : True if pin RB5 is high.
pinRB2 (boolean) : True if pin RB2 is high.
buttonPrg (boolean) : True if the PRG button was pressed since last QG or QB command.
penDown (boolean) : True if the pen is down.
commandExecuting (boolean) : True if a command is executing.
motor1Moving (boolean) : True if motor 1 is moving.
motor2Moving (boolean) : True if motor 2 is moving.
fifoEmpty (boolean) : True if the FIFO is empty.

MotorStatus

MotorStatus

Type: Object

Properties
executingMotion (boolean) : Whether a motion command is currently executing.
motorMoving (Array<boolean>) : Whether each motor is currently moving.
fifoEmpty (boolean) : Whether the motion FIFO is empty.