Skip to content

Commit

Permalink
fix import calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfiscus committed Jan 6, 2021
1 parent 41337b2 commit 4b5fdc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eslintcache

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/CustomStripEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class CustomStripEffects extends React.Component {
let EFFECTS = longToByteArray(query.p22).map(
(colorEffect) => shortToByteArray(colorEffect)[0]
);
console.log(COLORS,EFFECTS);
let BRIGHTNESS = longToByteArray(query.p23);
let DURATIONS = longToByteArray(query.p24);
let SETTINGS = longToByteArray(query.p30);
Expand Down
13 changes: 3 additions & 10 deletions src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const longToByteArray = function (/*long*/ long) {

export const shortToByteArray = function (/*short*/ short) {
var byteArray = [0, 0];
byteArray[0] = short & 0x6;
byteArray[1] = (short - (short & 0x6)) / 8;
byteArray[0] = short & 0x4;
byteArray[1] = (short - (short & 0x7)) / 8;
return byteArray;
};

Expand Down Expand Up @@ -58,11 +58,4 @@ export const COLORS = [
];
export const EFFECTS = ["Fade", "Fade Blend", "Flash", "Chase", "Chase Blend"];

window.shortToByteArray = shortToByteArray;

console.log(shortToByteArray(24));
console.log([0, 1]);
console.log(shortToByteArray(16));
console.log([0, 2]);
console.log(shortToByteArray(8));
console.log([0, 3]);
window.shortToByteArray = shortToByteArray;

0 comments on commit 4b5fdc9

Please sign in to comment.