From 1c81ecd23f6734c26f5397815756e4b0a2462157 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 3 Jan 2018 08:24:54 -0800 Subject: [PATCH] send ports data to console --- libs/core/screen.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/core/screen.ts b/libs/core/screen.ts index f70dc6e1..7d5894c4 100644 --- a/libs/core/screen.ts +++ b/libs/core/screen.ts @@ -221,10 +221,14 @@ namespace brick { // motors const datas = motors.getAllMotorData(); for(let i = 0; i < datas.length; ++i) { - const x = i * 52; const data = datas[i]; + if (!data.actualSpeed && !data.count) continue; + const x = i * 52; print(`${data.actualSpeed}%`, x, brick.LINE_HEIGHT) print(`${data.count}>`, x, 2 * brick.LINE_HEIGHT) + + console.logValue(`speed.` + "ABCD"[i], data.actualSpeed); + console.logValue(`angle.` + "ABCD"[i], data.count); } // sensors @@ -232,7 +236,10 @@ namespace brick { for(let i =0; i < sis.length; ++i) { const si = sis[i]; const x = (si.port() - 1) * 52; - print(`${si._query()}`, x, 9 * brick.LINE_HEIGHT) + const v = si._query(); + print(`${v}`, x, 9 * brick.LINE_HEIGHT) + + console.logValue(`sensor.` + si.port(), v); } } } \ No newline at end of file