diff --git a/libs/core/console.ts b/libs/core/console.ts index d2754ad3..87ec98a2 100644 --- a/libs/core/console.ts +++ b/libs/core/console.ts @@ -46,7 +46,7 @@ namespace console { //% export function addListener(listener: (text: string) => void) { if (!listener) return; - if (!listener) + if (!listeners) listeners = []; listeners.push(listener); } diff --git a/libs/core/led.ts b/libs/core/led.ts index f0dd3850..b317acf4 100644 --- a/libs/core/led.ts +++ b/libs/core/led.ts @@ -20,7 +20,7 @@ //% parts="ledmatrix" export function plotBarGraph(value: number, high: number): void { const now = input.runningTime(); - serial.writeLine(value.toString()); + console.logValue("", value); value = Math.abs(value); // auto-scale "high" is not provided