diff --git a/ardublockly/ardublockly_toolbox.js b/ardublockly/ardublockly_toolbox.js index bfddc2448e..a8a5346b7d 100644 --- a/ardublockly/ardublockly_toolbox.js +++ b/ardublockly/ardublockly_toolbox.js @@ -189,15 +189,22 @@ Ardublockly.TOOLBOX_XML = ' ' + ' ' + ' ' + - ' ' + - ' ' + + ' ' + + ' ' + ' ' + - ' 0' + + ' 1' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 50' + ' ' + ' ' + - ' ' + + ' ' + + ' ' + + ' ' + ' ' + - ' 30' + + ' 0' + ' ' + ' ' + ' ' + diff --git a/blockly/arduino_compressed.js b/blockly/arduino_compressed.js index 2d9b9b8118..75a609fe62 100644 --- a/blockly/arduino_compressed.js +++ b/blockly/arduino_compressed.js @@ -129,9 +129,10 @@ Blockly.Arduino.sensebox_button=function(){var a=this.getFieldValue("PIN"),b=thi Blockly.Arduino.sensebox_poti=function(){var a=this.getFieldValue("PIN");Blockly.Arduino.setups_.setup_poti="pinMode("+a+", INPUT);";return["analogRead("+a+")",Blockly.Arduino.ORDER_ATOMIC]};Blockly.Arduino.sensebox_foto=function(){var a=this.getFieldValue("PIN");Blockly.Arduino.setups_.setup_foto="pinMode("+a+", INPUT);";return["analogRead("+a+")",Blockly.Arduino.ORDER_ATOMIC]}; Blockly.Arduino.sensebox_rgb_led=function(){var a=this.getFieldValue("PIN"),b=Blockly.Arduino.valueToCode(this,"RED",Blockly.Arduino.ORDER_ATOMIC)||"0",c=Blockly.Arduino.valueToCode(this,"GREEN",Blockly.Arduino.ORDER_ATOMIC)||"0",d=Blockly.Arduino.valueToCode(this,"BLUE",Blockly.Arduino.ORDER_ATOMIC)||"0";Blockly.Arduino.definitions_["define_rgb_led"+a]="#include \n Adafruit_NeoPixel rgb_led_"+a+" = Adafruit_NeoPixel(1,"+a+",NEO_RGB + NEO_KHZ800);\n";Blockly.Arduino.setups_["setup_rgb_led"+ a]="rgb_led_"+a+".begin();";return"rgb_led_"+a+".setPixelColor(0,rgb_led_"+a+".Color("+b+","+c+","+d+"));\nrgb_led_"+(a+".show();")}; -Blockly.Arduino.sensebox_ws2818_led=function(){for(var a=this.getFieldValue("Port"),b=Ardublockly.workspace.getAllBlocks(),c=0,d=0;d\n Adafruit_NeoPixel rgb_led_"+a+"= Adafruit_NeoPixel("+b+", "+a+",NEO_GRB + NEO_KHZ800);\n";Blockly.Arduino.setups_["setup_rgb_led"+a]="rgb_led_"+a+".begin();";Blockly.Arduino.setups_["setup_rgb_led_brightness"+a]="rgb_led_"+a+".setBrightness("+c+");";return"rgb_led_"+a+".setPixelColor("+d+",rgb_led_"+ -a+".Color("+e+","+f+","+g+"));\nrgb_led_"+a+".show();\n"};Blockly.Arduino.sensebox_serial_print=function(){Blockly.Arduino.setups_.sensebox_serial_print="//Setup Serial Print\n Serial.begin(9600);\n";var a=this.getFieldValue("LINEBREAK");a="TRUE"==a?"ln":"";var b=Blockly.Arduino.valueToCode(this,"TEXT",Blockly.Arduino.ORDER_ATOMIC)||'"Keine Eingabe"';return"Serial.print"+a+"("+b+");\n"}; +Blockly.Arduino.sensebox_ws2818_led_init=function(a){var b=this.getFieldValue("Port"),c=Blockly.Arduino.valueToCode(this,"NumPixel",Blockly.Arduino.ORDER_ATOMIC)||"1";a=a.getFieldValue("RGB_NAME");var d=Blockly.Arduino.valueToCode(this,"BRIGHTNESS",Blockly.Arduino.ORDER_ATOMIC)||"50";Blockly.Arduino.definitions_["define_rgb_led"+b]="#include \n Adafruit_NeoPixel "+a+"= Adafruit_NeoPixel("+c+", "+b+",NEO_GRB + NEO_KHZ800);\n";Blockly.Arduino.setups_[a+"_begin"]=a+".begin();";Blockly.Arduino.setups_[a+ +"_brightness"]=a+".setBrightness("+d+");";return""}; +Blockly.Arduino.sensebox_ws2818_led=function(){var a=this.getFieldValue("RGB_NAME"),b=Blockly.Arduino.valueToCode(this,"POSITION",Blockly.Arduino.ORDER_ATOMIC)||"0",c=Blockly.Arduino.valueToCode(this,"RED",Blockly.Arduino.ORDER_ATOMIC)||"0",d=Blockly.Arduino.valueToCode(this,"GREEN",Blockly.Arduino.ORDER_ATOMIC)||"0",e=Blockly.Arduino.valueToCode(this,"BLUE",Blockly.Arduino.ORDER_ATOMIC)||"0";return a+".setPixelColor("+b+","+a+".Color("+c+","+d+","+e+"));\n"+a+".show();\n"}; +Blockly.Arduino.sensebox_serial_print=function(){Blockly.Arduino.setups_.sensebox_serial_print="//Setup Serial Print\n Serial.begin(9600);\n";var a=this.getFieldValue("LINEBREAK");a="TRUE"==a?"ln":"";var b=Blockly.Arduino.valueToCode(this,"TEXT",Blockly.Arduino.ORDER_ATOMIC)||'"Keine Eingabe"';return"Serial.print"+a+"("+b+");\n"}; Blockly.Arduino.sensebox_sd_create_file=function(a){a=this.getFieldValue("Filename");Blockly.Arduino.includes_.library_spi="#include ";Blockly.Arduino.includes_.library_sd="#include ";Blockly.Arduino.definitions_["define_"+a]="File dataFile"+a+";";Blockly.Arduino.setups_.sensebox_sd="SD.begin(28);";Blockly.Arduino.setups_["sensebox_sd"+a]="dataFile"+a+' = SD.open("'+a+'.txt", FILE_WRITE);\ndataFile'+a+".close();\n";return""}; Blockly.Arduino.sensebox_sd_open_file=function(a){var b=this.getFieldValue("Filename");Blockly.Arduino.valueToCode(this,"TEXT",Blockly.Arduino.ORDER_ATOMIC);a=Blockly.Arduino.statementToCode(a,"SD");return"dataFile"+b+' = SD.open("'+b+'.txt", FILE_WRITE);\n'+a+("dataFile"+b+".close();\n")}; Blockly.Arduino.sensebox_sd_write_file=function(a){if(null!=this.parentBlock_)var b=this.getSurroundParent().getFieldValue("Filename");a=Blockly.Arduino.valueToCode(this,"DATA",Blockly.Arduino.ORDER_ATOMIC)||'"Keine Eingabe"';var c=this.getFieldValue("linebreak");c="TRUE"==c?"ln":"";return"gps.getLongitude()"==a||"gps.getLatitude()"==a?"dataFile"+b+".print"+c+"("+a+",5);\n":"dataFile"+b+".print"+c+"("+a+");\n"}; diff --git a/blockly/blockly_compressed.js b/blockly/blockly_compressed.js index 1584ee71da..d6f9ea7bf8 100644 --- a/blockly/blockly_compressed.js +++ b/blockly/blockly_compressed.js @@ -21,10 +21,10 @@ a+'" has been loaded incorrectly.');b=b.require(b.getCurrentModulePath());goog.l goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e=0;e>>0); @@ -45,18 +45,18 @@ a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async c.target}if(a in this.requiresTranspilation_)return this.requiresTranspilation_[a]?!0:!goog.inHtmlDocument_()||"es6"!=b||"noModule"in goog.global.document.createElement("script")?!1:!0;throw Error("Unknown language mode: "+a);},goog.Transpiler.prototype.transpile=function(a,b){return goog.transpile_(a,b,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={}; this.idToPath_={};this.written_={};this.loadingDeps_=[];this.depsToLoad_=[];this.paused_=!1;this.factory_=new goog.DependencyFactory(goog.transpiler_);this.deferredCallbacks_={};this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(a,b){function c(){d&&(goog.global.setTimeout(d,0),d=null)}var d=b;if(a.length){for(var e=[],f=0;f\x3c/script>';f+="";f=goog.Dependency.defer_?f+("document.getElementById('script-"+e+"').onload = function() {\n goog.Dependency.callback_('"+e+"', this);\n};\n"):f+("goog.Dependency.callback_('"+e+"', document.getElementById('script-"+e+"'));");f+="\x3c/script>";b.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(f):f)}else{var g=b.createElement("script");g.defer=goog.Dependency.defer_; -g.async=!1;c&&(g.nonce=c);goog.DebugLoader_.IS_OLD_IE_?(a.pause(),g.onreadystatechange=function(){if("loaded"==g.readyState||"complete"==g.readyState)a.loaded(),a.resume()}):g.onload=function(){g.onload=null;a.loaded()};g.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path;b.head.appendChild(g)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."), +function(a){this.factory_=a},goog.DebugLoader_.prototype.load_=function(a){if(this.getPathFromDeps_(a)){var b=this,c=[],d=function(e){var f=b.getPathFromDeps_(e);if(!f)throw Error("Bad dependency path or symbol: "+e);if(!b.written_[f]){b.written_[f]=!0;e=b.dependencies_[f];for(f=0;f\x3c/script>';f+="";f=goog.Dependency.defer_?f+("document.getElementById('script-"+e+"').onload = function() {\n goog.Dependency.callback_('"+e+"', this);\n};\n"):f+("goog.Dependency.callback_('"+e+"', document.getElementById('script-"+e+"'));");f+="\x3c/script>";b.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(f):f)}else{var g=b.createElement("script");g.defer=goog.Dependency.defer_;g.async=!1;c&&(g.nonce= +c);goog.DebugLoader_.IS_OLD_IE_?(a.pause(),g.onreadystatechange=function(){if("loaded"==g.readyState||"complete"==g.readyState)a.loaded(),a.resume()}):g.onload=function(){g.onload=null;a.loaded()};g.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path;b.head.appendChild(g)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."), a.loaded()):a.pause()},goog.Es6ModuleDependency=function(a,b,c,d,e){goog.Dependency.call(this,a,b,c,d,e)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(a){function b(l,n){var m="",p=goog.getScriptNonce();p&&(m=' nonce="'+p+'"');m=n?'