From 7783efc9bdf8c02b838316fad149d0b30e47ce02 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 29 Oct 2018 22:09:28 -0700 Subject: [PATCH] pipe led.plotbargraph through console.log (#1557) --- libs/core/console.ts | 2 +- libs/core/led.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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