Board
#Extends
EventEmitter
#Constructors
#Constructor
TypeScript
new Board(portPath?, options?): Board;Create a Board instance.
#Parameters
| Parameter | Type | Description |
|---|---|---|
portPath? | string | null | Serial port path (e.g. "/dev/tty.usbserial-XXXX" or "COM3"). Pass null or omit to auto-detect the connected blokdots board. Example: "/dev/tty.usbserial-XXXX" on Mac, "COM3" on Windows. |
options? | BoardOptions | Optional configuration (expectedHash, autoDetectTimeoutMs). |
#Returns
Board
#Overrides
TypeScript
EventEmitter.constructor#Methods
#close()
TypeScript
close(callback?): void;#Parameters
| Parameter | Type |
|---|---|
callback? | () => void |
#Returns
void
#isConnected()
TypeScript
isConnected(): boolean;#Returns
boolean
#queryConfigHash()
TypeScript
queryConfigHash(): void;Query the board's config hash. The board will respond with a 'hash' event containing the hash string.
#Returns
void
#registerComponent()
TypeScript
registerComponent(id, component): void;Register a component with the board. Accepts Pin (number for digital, string for analog), I2CPinID, or any string identifier. Converts to string internally for Map storage.
#Parameters
| Parameter | Type |
|---|---|
id | string | number |
component | ComponentBase |
#Returns
void
#sendCommand()
TypeScript
sendCommand(command): void;#Parameters
| Parameter | Type |
|---|---|
command | string |
#Returns
void