File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
scratch-arduino-extensions/packages/scratch-vm/src/extensions/arduino_basics Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ const iconURI = "";
1919// eslint-disable-next-line max-len
2020const menuIconURI = "" ;
2121
22- const wsServerURL = `${ window . location . protocol } //${ window . location . hostname } :7000` ;
22+ // const wsServerURL = `${window.location.protocol}//${window.location.hostname}:7000`;
2323
24+ const wsServerURL = `ws://192.168.1.39:7000` ;
2425class ArduinoBasics {
2526 constructor ( runtime ) {
2627 this . runtime = runtime ;
@@ -52,6 +53,13 @@ ArduinoBasics.prototype.getInfo = function() {
5253 } ,
5354 } ,
5455 } ,
56+ {
57+ opcode : "matrixClear" ,
58+ blockType : BlockType . COMMAND ,
59+ text : "clear matrix" ,
60+ func : "matrixClear" ,
61+ arguments : { } ,
62+ } ,
5563 {
5664 opcode : "setLed3" ,
5765 blockType : BlockType . COMMAND ,
@@ -85,6 +93,11 @@ ArduinoBasics.prototype.matrixDraw = function(args) {
8593 this . io . emit ( "matrix_draw" , { frame : args . FRAME } ) ;
8694} ;
8795
96+ ArduinoBasics . prototype . matrixClear = function ( ) {
97+ console . log ( "Clearing matrix" ) ;
98+ this . io . emit ( "matrix_draw" , { frame : "0000000000000000000000000" } ) ;
99+ } ;
100+
88101ArduinoBasics . prototype . setLed3 = function ( args ) {
89102 const hexColor = args . HEX ;
90103 const rgb = this . hexToRgb ( hexColor ) ;
You can’t perform that action at this time.
0 commit comments