resetup led
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import Firmata from 'firmata';
|
||||
import { SuBoard } from './support';
|
||||
|
||||
export const comport: string = '/dev/ttyUSB0';
|
||||
export const comport: string = '/dev/ttyUSB1';
|
||||
export const board: Firmata = new Firmata(comport);
|
||||
|
||||
export const suBoard = {
|
||||
connected: false,
|
||||
PIN: {
|
||||
servo: 0,
|
||||
rgb_led: {
|
||||
r: 10,
|
||||
g: 9,
|
||||
b: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
export const suBoard: SuBoard = new SuBoard();
|
||||
20
src/setup/support.ts
Normal file
20
src/setup/support.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface SupportBoard {
|
||||
connected: boolean,
|
||||
PINS: {
|
||||
pwm: number[],
|
||||
analog: number[],
|
||||
}
|
||||
sort: () => void
|
||||
}
|
||||
|
||||
export class SuBoard implements SupportBoard {
|
||||
public connected = false;
|
||||
public PINS = {
|
||||
pwm: [],
|
||||
analog: []
|
||||
};
|
||||
public sort() {
|
||||
this.PINS.pwm = this.PINS.pwm.sort((a, b) => b - a);
|
||||
this.PINS.analog = this.PINS.analog.sort((a, b) => b - a);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user