Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ const iconURI = "";
// eslint-disable-next-line max-len
const menuIconURI = "";

const wsServerURL = `${window.location.protocol}//${window.location.hostname}:7000`;
// const wsServerURL = `${window.location.protocol}//${window.location.hostname}:7000`;

const wsServerURL = `ws://192.168.1.39:7000`;
class ArduinoBasics {
constructor(runtime) {
this.runtime = runtime;
Expand Down Expand Up @@ -52,6 +53,13 @@ ArduinoBasics.prototype.getInfo = function() {
},
},
},
{
opcode: "matrixClear",
blockType: BlockType.COMMAND,
text: "clear matrix",
func: "matrixClear",
arguments: {},
},
{
opcode: "setLed3",
blockType: BlockType.COMMAND,
Expand Down Expand Up @@ -85,6 +93,11 @@ ArduinoBasics.prototype.matrixDraw = function(args) {
this.io.emit("matrix_draw", { frame: args.FRAME });
};

ArduinoBasics.prototype.matrixClear = function() {
console.log("Clearing matrix");
this.io.emit("matrix_draw", { frame: "0000000000000000000000000" });
};

ArduinoBasics.prototype.setLed3 = function(args) {
const hexColor = args.HEX;
const rgb = this.hexToRgb(hexColor);
Expand Down
Loading