Piezo buzzer, portlist and update documentation

This commit is contained in:
2024-03-03 18:47:55 +07:00
parent 71c4ec5072
commit f90387bab9
11 changed files with 259 additions and 19 deletions

View File

@@ -1,11 +1,14 @@
import { SuBoard } from './support';
import { Board } from 'johnny-five';
import { config } from 'dotenv';
export const comport: string = '/dev/ttyUSB0';
export const board: Board = new Board({
config();
export const comport: string = process.env.SERIAL_PORT || '/dev/ttyUSB0';
export const suBoard: SuBoard = new SuBoard();
export const board: Board | null = new Board({
port: comport,
repl: false,
debug: false
});
export const suBoard: SuBoard = new SuBoard();
});

View File

@@ -1,4 +1,5 @@
export interface SupportBoard {
port: string | null,
connected: boolean,
PINS: {
pwm: number[],
@@ -8,6 +9,7 @@ export interface SupportBoard {
}
export class SuBoard implements SupportBoard {
public port = null;
public connected = false;
public PINS = {
pwm: [],