From ba8e89a46287f49b7c55fbb502ce2629ba25b3f8 Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Mon, 26 May 2025 18:47:09 -0400 Subject: [PATCH 1/9] Import and export capability --- app.js | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 13 +++++-- 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 94c437e..eb63c55 100644 --- a/app.js +++ b/app.js @@ -144,6 +144,18 @@ function initOptions() { matrix_left = createArray(matrix_left.length, matrix_left[0].length); updateTableLeft(); sendToDisplay(true); + }); + $('#importLeftBtn').click(function() { + importMatrixLeft(); + }); + $('#imporRighttBtn').click(function() { + importMatrixRight(); + }); + $('#exportLeftBtn').click(function() { + exportMatrixLeft(); + }); + $('#exporRighttBtn').click(function() { + exportMatrixRight(); }); $('#wakeBtn').click(function() { wake(portLeft, true); @@ -264,6 +276,93 @@ function prepareValsForDrawingRight() { return vals; } +function setMatrixLeftFromVals(vals) { + const width = matrix_left[0].length; + const height = matrix_left.length; + + for (let col = 0; col < width; col++) { + for (let row = 0; row < height; row++) { + matrix_left[row][col] = vals.shift(); + } + } + +function setMatrixRightFromVals(vals) { + const width = matrix_right[0].length; + const height = matrix_right.length; + + for (let col = 0; col < width; col++) { + for (let row = 0; row < height; row++) { + matrix_right[row][col] = vals.shift(); + } + } +} + +function exportMatrixLeft() { + const vals = prepareValsForDrawingLeft(); + //save json file + const blob = new Blob([JSON.stringify(vals)], { type: "application/json" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "matrix_left.json"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); +} + +function exportMatrixRight() { + const vals = prepareValsForDrawingRight(); + //save json file + const blob = new Blob([JSON.stringify(vals)], { type: "application/json" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "matrix_right.json"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); +} + +function importMatrixLeft() { + const input = document.createElement("input"); + input.type = "file"; + input.accept = ".json"; + input.onchange = async function (event) { + const file = event.target.files[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = function (e) { + const vals = JSON.parse(e.target.result); + setMatrixLeftFromVals(vals); + updateTableLeft(); + sendToDisplay(true); + }; + reader.readAsText(file); + }; + input.click(); +} +function importMatrixRight() { + const input = document.createElement("input"); + input.type = "file"; + input.accept = ".json"; + input.onchange = async function (event) { + const file = event.target.files[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = function (e) { + const vals = JSON.parse(e.target.result); + setMatrixRightFromVals(vals); + updateTableRight(); + sendToDisplay(true); + }; + reader.readAsText(file); + }; + input.click(); +} async function sendToDisplay(recurse) { await sendToDisplayLeft(recurse); diff --git a/index.html b/index.html index 4c3bfaa..afd6c2b 100644 --- a/index.html +++ b/index.html @@ -80,8 +80,17 @@

Device Information

- - +
+ + +
+
+ + +
+
+ +

Learn More

From a337c6614540fd8ecad6a88ef3fb58f0e8b3962e Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Wed, 28 May 2025 00:08:53 -0400 Subject: [PATCH 2/9] Import and export --- app.js | 45 +++++++++++++++++++++++++++++++++++---------- index.html | 1 - 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index eb63c55..2ada4da 100644 --- a/app.js +++ b/app.js @@ -148,13 +148,13 @@ function initOptions() { $('#importLeftBtn').click(function() { importMatrixLeft(); }); - $('#imporRighttBtn').click(function() { + $('#importRightBtn').click(function() { importMatrixRight(); }); $('#exportLeftBtn').click(function() { exportMatrixLeft(); }); - $('#exporRighttBtn').click(function() { + $('#exportRightBtn').click(function() { exportMatrixRight(); }); $('#wakeBtn').click(function() { @@ -258,6 +258,22 @@ function prepareValsForDrawingLeft() { return vals; } +function getCellVals(vals) { + const cellVals = [] + for (const val of vals) { + const bVal = val.toString(2).split('').reverse().join(''); + const s = bVal.padEnd(8, "0") + for (const c of s) { + if (cellVals.length < 306) { + cellVals.push(parseInt(c)) + } else { + break; + } + } + } + return cellVals; +} + function prepareValsForDrawingRight() { const width = matrix_right[0].length; const height = matrix_right.length; @@ -279,20 +295,25 @@ function prepareValsForDrawingRight() { function setMatrixLeftFromVals(vals) { const width = matrix_left[0].length; const height = matrix_left.length; + const cellVals = getCellVals(vals); - for (let col = 0; col < width; col++) { - for (let row = 0; row < height; row++) { - matrix_left[row][col] = vals.shift(); + for (let row = 0; row < height; row++) { + for (let col = 0; col < width; col++) { + const val = cellVals.shift() + matrix_left[row][col] = (val + 1) % 2; } } +} function setMatrixRightFromVals(vals) { const width = matrix_right[0].length; const height = matrix_right.length; + const cellVals = getCellVals(vals); - for (let col = 0; col < width; col++) { - for (let row = 0; row < height; row++) { - matrix_right[row][col] = vals.shift(); + for (let row = 0; row < height; row++) { + for (let col = 0; col < width; col++) { + const val = cellVals.shift() + matrix_right[row][col] = (val + 1) % 2; } } } @@ -313,6 +334,8 @@ function exportMatrixLeft() { function exportMatrixRight() { const vals = prepareValsForDrawingRight(); + console.log('Exported values') + console.log(vals) //save json file const blob = new Blob([JSON.stringify(vals)], { type: "application/json" }); const url = URL.createObjectURL(blob); @@ -337,7 +360,8 @@ function importMatrixLeft() { reader.onload = function (e) { const vals = JSON.parse(e.target.result); setMatrixLeftFromVals(vals); - updateTableLeft(); + // updateTableLeft(); + updateMatrix(matrix_left, 'left') sendToDisplay(true); }; reader.readAsText(file); @@ -356,7 +380,8 @@ function importMatrixRight() { reader.onload = function (e) { const vals = JSON.parse(e.target.result); setMatrixRightFromVals(vals); - updateTableRight(); + // updateTableRight(); + updateMatrix(matrix_right, 'right') sendToDisplay(true); }; reader.readAsText(file); diff --git a/index.html b/index.html index afd6c2b..793df9c 100644 --- a/index.html +++ b/index.html @@ -88,7 +88,6 @@

Device Information

-
From 6829123ec4126b1a002f407dfb46508de23f8039 Mon Sep 17 00:00:00 2001 From: Mark Leone Date: Wed, 28 May 2025 10:58:15 -0400 Subject: [PATCH 3/9] Use bit mask for setting matrix vals on import --- app.js | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/app.js b/app.js index 2ada4da..b1745a0 100644 --- a/app.js +++ b/app.js @@ -258,22 +258,6 @@ function prepareValsForDrawingLeft() { return vals; } -function getCellVals(vals) { - const cellVals = [] - for (const val of vals) { - const bVal = val.toString(2).split('').reverse().join(''); - const s = bVal.padEnd(8, "0") - for (const c of s) { - if (cellVals.length < 306) { - cellVals.push(parseInt(c)) - } else { - break; - } - } - } - return cellVals; -} - function prepareValsForDrawingRight() { const width = matrix_right[0].length; const height = matrix_right.length; @@ -295,12 +279,13 @@ function prepareValsForDrawingRight() { function setMatrixLeftFromVals(vals) { const width = matrix_left[0].length; const height = matrix_left.length; - const cellVals = getCellVals(vals); for (let row = 0; row < height; row++) { for (let col = 0; col < width; col++) { - const val = cellVals.shift() - matrix_left[row][col] = (val + 1) % 2; + const i = col + row * width; + const val = vals[Math.trunc(i/8)] + const bit = (val >> i % 8) & 1; + matrix_left[row][col] = (bit + 1) % 2; } } } @@ -308,12 +293,13 @@ function setMatrixLeftFromVals(vals) { function setMatrixRightFromVals(vals) { const width = matrix_right[0].length; const height = matrix_right.length; - const cellVals = getCellVals(vals); for (let row = 0; row < height; row++) { for (let col = 0; col < width; col++) { - const val = cellVals.shift() - matrix_right[row][col] = (val + 1) % 2; + const i = col + row * width; + const val = vals[Math.trunc(i/8)] + const bit = (val >> i % 8) & 1; + matrix_right[row][col] = (bit + 1) % 2; } } } From b4f86e8f15e42ee3fcda1e3f37457b6405bf97de Mon Sep 17 00:00:00 2001 From: Mark Leone Date: Wed, 28 May 2025 11:11:56 -0400 Subject: [PATCH 4/9] Set select val to custom on import --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index b1745a0..e1eed10 100644 --- a/app.js +++ b/app.js @@ -346,9 +346,9 @@ function importMatrixLeft() { reader.onload = function (e) { const vals = JSON.parse(e.target.result); setMatrixLeftFromVals(vals); - // updateTableLeft(); updateMatrix(matrix_left, 'left') sendToDisplay(true); + $("#select-left").val('Custom'); }; reader.readAsText(file); }; @@ -366,9 +366,9 @@ function importMatrixRight() { reader.onload = function (e) { const vals = JSON.parse(e.target.result); setMatrixRightFromVals(vals); - // updateTableRight(); updateMatrix(matrix_right, 'right') sendToDisplay(true); + $("#select-right").val('Custom'); }; reader.readAsText(file); }; From 1d4b791c7582687ae2649fc0b730b985e6f9b79c Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Sat, 31 May 2025 22:32:34 -0400 Subject: [PATCH 5/9] Add persistence option --- app.js | 19 +++++++++++++++++++ index.html | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index e1eed10..301fc1c 100644 --- a/app.js +++ b/app.js @@ -20,6 +20,7 @@ const VERSION_CMD = 0x20; const WIDTH = 9; const HEIGHT = 34; +const WAKE_LOOP_INTERVAL_MSEC = 50_000 const PATTERNS = [ 'Custom', @@ -42,13 +43,16 @@ var msbendian = false; let portLeft = null; let portRight = null; let swap = false; +let persist = false $(function() { matrix_left = createArray(34, 9); matrix_right = createArray(34, 9); + updateTableLeft(); updateTableRight(); initOptions(); + startWakeLoop() for (pattern of PATTERNS) { $("#select-left").append(``); @@ -67,6 +71,8 @@ $(function() { } }); +// startWakeLoop() + function drawPattern(matrix, pattern, pos) { for (let col = 0; col < WIDTH; col++) { for (let row = 0; row < HEIGHT; row++) { @@ -164,6 +170,9 @@ function initOptions() { $('#sleepBtn').click(function() { wake(portLeft, false); wake(portRight, false); + }); + $('#persistCb').click(function() { + persist = !persist; }); $('#bootloaderBtn').click(function() { bootloader(portLeft); @@ -496,6 +505,16 @@ function createArray(length) { return arr; } +function startWakeLoop() { + setInterval(() => { + if (persist) { + console.log('WAKE') + wake(portLeft, true); + wake(portRight, true); + } + }, WAKE_LOOP_INTERVAL_MSEC) +} + async function wake(port, wake) { await sendCommand(port, 0x03, [wake ? 0 : 1]); } diff --git a/index.html b/index.html index 793df9c..416f631 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,9 @@

Device Information

- +
+ Persist +

From 25fafeac754eb037a0e2fb7429709c4b3e9128bf Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Sat, 9 Aug 2025 16:39:53 -0400 Subject: [PATCH 6/9] Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake --- README | 1 + app.js | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..3f14138 --- /dev/null +++ b/README @@ -0,0 +1 @@ +Changes from recovered fw dir. Not sure if this is latest diff --git a/app.js b/app.js index 301fc1c..ac44c8b 100644 --- a/app.js +++ b/app.js @@ -54,7 +54,7 @@ $(function() { initOptions(); startWakeLoop() - for (pattern of PATTERNS) { + for (const pattern of PATTERNS) { $("#select-left").append(``); $("#select-left").on("change", async function() { if (pattern == 'Custom') return; @@ -158,10 +158,20 @@ function initOptions() { importMatrixRight(); }); $('#exportLeftBtn').click(function() { - exportMatrixLeft(); + //Export raw data (i.e. a 2D array instead of a 1d array of encoded bits) + exportMatrixLeft(true); + // No need to suport export of encoded file since import can handle either type + // exportMatrixLeft(false) }); $('#exportRightBtn').click(function() { +<<<<<<< HEAD exportMatrixRight(); +======= + //Export raw data (i.e. a 2D array instead of a 1d array of encoded bits) + exportMatrixRight(true); + // No need to suport export of encoded file since import can handle either type + // exportMatrixRight(false) +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) }); $('#wakeBtn').click(function() { wake(portLeft, true); @@ -249,6 +259,7 @@ async function checkFirmwareVersion(port, side) { reader.releaseLock(); } +//Get matrix values encoded as a 39-byte array function prepareValsForDrawingLeft() { const width = matrix_left[0].length; const height = matrix_left.length; @@ -267,6 +278,7 @@ function prepareValsForDrawingLeft() { return vals; } +//Get matrix values encoded as a 39-byte array function prepareValsForDrawingRight() { const width = matrix_right[0].length; const height = matrix_right.length; @@ -285,6 +297,45 @@ function prepareValsForDrawingRight() { return vals; } +//Get matrix values set directly in a 39 x 9 item array +function getRawValsMatrixRight() { + const width = matrix_right[0].length; + const height = matrix_right.length; + + let vals = new Array(height) + for (const i in [...Array(height).keys()]) { + vals[i] = Array(width).fill(0) + } + + for (let col = 0; col < width; col++) { + for (let row = 0; row < height; row++) { + const cell = matrix_right[row][col]; + vals[row][col] = (cell == null || cell == 1) ? 0 : 1 + } + } + return vals; +} + +//Get matrix values set directly in a 39 x 9 item array +function getRawValsMatrixLeft() { + const width = matrix_left[0].length; + const height = matrix_left.length; + + let vals = new Array(height) + for (const i in [...Array(height).keys()]) { + vals[i] = Array(width).fill(0) + } + + for (let col = 0; col < width; col++) { + for (let row = 0; row < height; row++) { + const cell = matrix_left[row][col]; + vals[row][col] = (cell == null || cell == 1) ? 0 : 1 + } + } + return vals; +} + +//Set matrix values by decoding a 39-byte array function setMatrixLeftFromVals(vals) { const width = matrix_left[0].length; const height = matrix_left.length; @@ -295,10 +346,28 @@ function setMatrixLeftFromVals(vals) { const val = vals[Math.trunc(i/8)] const bit = (val >> i % 8) & 1; matrix_left[row][col] = (bit + 1) % 2; +<<<<<<< HEAD + } + } +} + +function setMatrixRightFromVals(vals) { + const width = matrix_right[0].length; + const height = matrix_right.length; + + for (let row = 0; row < height; row++) { + for (let col = 0; col < width; col++) { + const i = col + row * width; + const val = vals[Math.trunc(i/8)] + const bit = (val >> i % 8) & 1; + matrix_right[row][col] = (bit + 1) % 2; +======= +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) } } } +//Set matrix values by decoding a 39-byte array function setMatrixRightFromVals(vals) { const width = matrix_right[0].length; const height = matrix_right.length; @@ -313,8 +382,39 @@ function setMatrixRightFromVals(vals) { } } -function exportMatrixLeft() { - const vals = prepareValsForDrawingLeft(); +//Set matrix values from a 39 x 9 item array +function setMatrixRightFromRawVals(vals) { + const width = matrix_right[0].length; + const height = matrix_right.length; + + for (let row = 0; row < height; row++) { + for (let col = 0; col < width; col++) { + matrix_right[row][col] = !!!vals[row][col] + } + } +} + +//Set matrix values from a 39 x 9 item array +function setMatrixLeftFromRawVals(vals) { + const width = matrix_left[0].length; + const height = matrix_left.length; + + for (let row = 0; row < height; row++) { + for (let col = 0; col < width; col++) { + matrix_left[row][col] = !!!vals[row][col] + } + } +} + +function exportMatrixLeft(raw) { + let vals + if (raw) { + //set vals as a 39 by 9 byte array + vals = getRawValsMatrixLeft() + } else { + //encode vals into a 39-byte array + vals = prepareValsForDrawingLeft(); + } //save json file const blob = new Blob([JSON.stringify(vals)], { type: "application/json" }); const url = URL.createObjectURL(blob); @@ -327,8 +427,20 @@ function exportMatrixLeft() { URL.revokeObjectURL(url); } +<<<<<<< HEAD function exportMatrixRight() { const vals = prepareValsForDrawingRight(); +======= +function exportMatrixRight(raw) { + let vals + if (raw) { + //set vals as a 39 by 9 byte array + vals = getRawValsMatrixRight() + } else { + //encode vals into a 39-byte array + vals = prepareValsForDrawingRight(); + } +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) console.log('Exported values') console.log(vals) //save json file @@ -336,7 +448,7 @@ function exportMatrixRight() { const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; - a.download = "matrix_right.json"; + a.download = `${raw ? 'matrix_right(raw).json' : 'matrix_right.json'}`; document.body.appendChild(a); a.click(); document.body.removeChild(a); @@ -354,7 +466,15 @@ function importMatrixLeft() { const reader = new FileReader(); reader.onload = function (e) { const vals = JSON.parse(e.target.result); +<<<<<<< HEAD setMatrixLeftFromVals(vals); +======= + if (vals[0].length > 1) { + setMatrixLeftFromRawVals(vals) + } else { + setMatrixLeftFromVals(vals); + } +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) updateMatrix(matrix_left, 'left') sendToDisplay(true); $("#select-left").val('Custom'); @@ -374,7 +494,15 @@ function importMatrixRight() { const reader = new FileReader(); reader.onload = function (e) { const vals = JSON.parse(e.target.result); +<<<<<<< HEAD setMatrixRightFromVals(vals); +======= + if (vals[0].length > 1) { + setMatrixRightFromRawVals(vals) + } else { + setMatrixRightFromVals(vals); + } +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) updateMatrix(matrix_right, 'right') sendToDisplay(true); $("#select-right").val('Custom'); @@ -508,7 +636,10 @@ function createArray(length) { function startWakeLoop() { setInterval(() => { if (persist) { +<<<<<<< HEAD console.log('WAKE') +======= +>>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) wake(portLeft, true); wake(portRight, true); } From 87ef0ea755d66d8f1d55502fc935fe8211e04b3b Mon Sep 17 00:00:00 2001 From: Mark Leone Date: Sat, 9 Aug 2025 17:01:30 -0400 Subject: [PATCH 7/9] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b704690..efaae75 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ -# Framework Laptop 16 LED Matrix Input Module Control +# Framework Laptop 16 LED Matrix Input Module Controlh +## The upstream repo is apparently no longer monitored, so this fork will probably never be merged. + +The following enhancements are provided: + +- Import export capability + - Matrix values are saved as a 39 by 9 byte array +- Persist button + - Continually wakes the matrix when selected, so the display does not turn off + [View it in your browser.](https://ledmatrix.frame.work) This little web app can directly connect to the Framework Laptop 16 LED matrix From 4abfd8476fc5e6a072e21d6e918e4e3c97aefe12 Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Sat, 9 Aug 2025 17:07:02 -0400 Subject: [PATCH 8/9] Commit merge changes not saved in editor before previous commit --- app.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/app.js b/app.js index ac44c8b..6a05a7c 100644 --- a/app.js +++ b/app.js @@ -164,14 +164,10 @@ function initOptions() { // exportMatrixLeft(false) }); $('#exportRightBtn').click(function() { -<<<<<<< HEAD - exportMatrixRight(); -======= //Export raw data (i.e. a 2D array instead of a 1d array of encoded bits) exportMatrixRight(true); // No need to suport export of encoded file since import can handle either type // exportMatrixRight(false) ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) }); $('#wakeBtn').click(function() { wake(portLeft, true); @@ -346,23 +342,6 @@ function setMatrixLeftFromVals(vals) { const val = vals[Math.trunc(i/8)] const bit = (val >> i % 8) & 1; matrix_left[row][col] = (bit + 1) % 2; -<<<<<<< HEAD - } - } -} - -function setMatrixRightFromVals(vals) { - const width = matrix_right[0].length; - const height = matrix_right.length; - - for (let row = 0; row < height; row++) { - for (let col = 0; col < width; col++) { - const i = col + row * width; - const val = vals[Math.trunc(i/8)] - const bit = (val >> i % 8) & 1; - matrix_right[row][col] = (bit + 1) % 2; -======= ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) } } } @@ -427,10 +406,6 @@ function exportMatrixLeft(raw) { URL.revokeObjectURL(url); } -<<<<<<< HEAD -function exportMatrixRight() { - const vals = prepareValsForDrawingRight(); -======= function exportMatrixRight(raw) { let vals if (raw) { @@ -440,7 +415,6 @@ function exportMatrixRight(raw) { //encode vals into a 39-byte array vals = prepareValsForDrawingRight(); } ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) console.log('Exported values') console.log(vals) //save json file @@ -466,15 +440,11 @@ function importMatrixLeft() { const reader = new FileReader(); reader.onload = function (e) { const vals = JSON.parse(e.target.result); -<<<<<<< HEAD - setMatrixLeftFromVals(vals); -======= if (vals[0].length > 1) { setMatrixLeftFromRawVals(vals) } else { setMatrixLeftFromVals(vals); } ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) updateMatrix(matrix_left, 'left') sendToDisplay(true); $("#select-left").val('Custom'); @@ -494,15 +464,11 @@ function importMatrixRight() { const reader = new FileReader(); reader.onload = function (e) { const vals = JSON.parse(e.target.result); -<<<<<<< HEAD - setMatrixRightFromVals(vals); -======= if (vals[0].length > 1) { setMatrixRightFromRawVals(vals) } else { setMatrixRightFromVals(vals); } ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) updateMatrix(matrix_right, 'right') sendToDisplay(true); $("#select-right").val('Custom'); @@ -636,10 +602,6 @@ function createArray(length) { function startWakeLoop() { setInterval(() => { if (persist) { -<<<<<<< HEAD - console.log('WAKE') -======= ->>>>>>> 5918936 (Support 2d or 1d arrray for import and export. Provide persist option to keep matrix awake) wake(portLeft, true); wake(portRight, true); } From 528ce7c903ec031f622bd0ae368bba2fbaffd690 Mon Sep 17 00:00:00 2001 From: "Leone, Mark A [LGS]" Date: Tue, 20 Jan 2026 17:28:36 -0500 Subject: [PATCH 9/9] Correcting comments to avoid confusion --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 6a05a7c..bfa996d 100644 --- a/app.js +++ b/app.js @@ -388,7 +388,7 @@ function setMatrixLeftFromRawVals(vals) { function exportMatrixLeft(raw) { let vals if (raw) { - //set vals as a 39 by 9 byte array + //set vals as a 34 by 9 byte array vals = getRawValsMatrixLeft() } else { //encode vals into a 39-byte array @@ -409,7 +409,7 @@ function exportMatrixLeft(raw) { function exportMatrixRight(raw) { let vals if (raw) { - //set vals as a 39 by 9 byte array + //set vals as a 34 by 9 byte array vals = getRawValsMatrixRight() } else { //encode vals into a 39-byte array