From 3160024ae7a5fd268a84d7c2001fa6da9125ca83 Mon Sep 17 00:00:00 2001 From: Irene-Maxine <114802521+Irene-Maxine@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=20=E8=AE=BE=E5=A4=87=E5=90=8D+=E8=8B=B1=E6=96=87=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../micropython/blocks/sensor_extern.js | 48 +++++++++---------- .../micropython/generators/sensor_extern.js | 2 +- .../micropython_esp32/template.xml | 2 +- .../micropython_esp32c2/template.xml | 2 +- .../micropython_esp32c3/template.xml | 2 +- .../micropython_esp32s2/template.xml | 2 +- .../micropython_esp32s3/template.xml | 2 +- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/boards/default_src/micropython/blocks/sensor_extern.js b/boards/default_src/micropython/blocks/sensor_extern.js index 4cfbb851..c853130d 100644 --- a/boards/default_src/micropython/blocks/sensor_extern.js +++ b/boards/default_src/micropython/blocks/sensor_extern.js @@ -251,7 +251,7 @@ export const sensor_bmp = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("BMP280") + .appendField(Blockly.Msg.MIXLY_ALTITUDE_SENSOR+" BMP280") .setCheck("var"); this.appendDummyInput("") .appendField(new Blockly.FieldDropdown([ @@ -276,7 +276,7 @@ export const sensor_sht = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("SHT20") + .appendField(Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR +" SHT20") .setCheck("var"); this.appendDummyInput("") .appendField(new Blockly.FieldDropdown([ @@ -341,24 +341,24 @@ export const sensor_use_i2c_init = { this.appendDummyInput("") .appendField(Blockly.Msg.MIXLY_SETUP + Blockly.Msg.LISTS_SET_INDEX_INPUT_TO) .appendField(new Blockly.FieldDropdown([ - [Blockly.Msg.MIXLY_ESP32_EXTERN_LIGHT+"LTR-308-ALS", "LTR308"], - [Blockly.Msg.MIXLY_COLOR_SENSOR+"LTR-381-RGB", "LTR381RGB"], - [Blockly.Msg.MIXLY_COLOR_SENSOR+"UCS12071","UCS12071"], - [Blockly.Msg.MIXLY_EXTERN_LIGHTUV +"LTR390UV","LTR390UV"], - [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"HP203X", "HP203X"], - [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"SPL06_001","SPL06_001"], - [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"BMP280", "BMP280"], - [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "SHTC3", "SHTC3"], - [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "AHT21", "AHT21"], - [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "SHT20", "SHT20"], - [Blockly.Msg.MIXLY_LASER_RANGE_SENSOR + "VL53L0X", "VL53L0X"], - [Blockly.Msg.MIXLY_GEOMAGNETIC_SENSOR + "QMC5883L", "QMC5883L"], - [Blockly.Msg.MIXLY_ESP32_MAX30102+"MAX30102", "MAX30102"], - [Blockly.Msg.HTML_COLOUR +"、"+ Blockly.Msg.MIXLY_ENVIRONMENT_LIGHT+"、"+Blockly.Msg.MIXLY_NEXT+"、"+Blockly.Msg.MIXLY_ESP32_APDS9960+"APDS9960", "APDS9960"], - [Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+"MPU9250", "MPU9250"], - [Blockly.Msg.MixGo_MPU9250+"ADXL345", "ADXL345"], + [Blockly.Msg.MIXLY_ESP32_EXTERN_LIGHT+"(LTR-308-ALS)", "LTR308"], + [Blockly.Msg.MIXLY_COLOR_SENSOR+"(LTR-381-RGB)", "LTR381RGB"], + [Blockly.Msg.MIXLY_COLOR_SENSOR+"(UCS12071)","UCS12071"], + [Blockly.Msg.MIXLY_EXTERN_LIGHTUV +"(LTR390UV)","LTR390UV"], + [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"(HP203X)", "HP203X"], + [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"(SPL06_001)","SPL06_001"], + [Blockly.Msg.MIXLY_ALTITUDE_SENSOR+"(BMP280)", "BMP280"], + [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "(SHTC3)", "SHTC3"], + [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "(AHT21)", "AHT21"], + [Blockly.Msg.MIXLY_TEMP_AND_HUMIDITY_SENSOR + "(SHT20)", "SHT20"], + [Blockly.Msg.MIXLY_LASER_RANGE_SENSOR + "(VL53L0X)", "VL53L0X"], + [Blockly.Msg.MIXLY_GEOMAGNETIC_SENSOR + "(QMC5883L)", "QMC5883L"], + [Blockly.Msg.MIXLY_ESP32_MAX30102+"(MAX30102)", "MAX30102"], + [Blockly.Msg.HTML_COLOUR +"、"+ Blockly.Msg.MIXLY_ENVIRONMENT_LIGHT+"、"+Blockly.Msg.MIXLY_NEXT+"、"+Blockly.Msg.MIXLY_ESP32_APDS9960+"(APDS9960)", "APDS9960"], + [Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+"(MPU9250)", "MPU9250"], + [Blockly.Msg.MixGo_MPU9250+"(ADXL345)", "ADXL345"], ["RFID", "RFID"], - [Blockly.Msg.MIXLY_RADAR_SENSOR+"CBR817", "CBR817"] + [Blockly.Msg.MIXLY_RADAR_SENSOR+"(CBR817)", "CBR817"] ]), "key"); this.setInputsInline(true); this.setPreviousStatement(true, null); @@ -667,7 +667,7 @@ export const sensor_mpu9250_get_acceleration = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("MPU9250") + .appendField(Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250") .setCheck("var"); this.appendDummyInput() .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_ACCELERATION) @@ -701,7 +701,7 @@ export const sensor_mpu9250_get_magnetic = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("MPU9250") + .appendField(Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250") .setCheck("var"); this.appendDummyInput() .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_GET + Blockly.Msg.MIXLY_MICROBIT_JS_FIELD_STRENGTH) @@ -734,7 +734,7 @@ export const sensor_mpu9250_get_gyro = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("MPU9250") + .appendField(Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250") .setCheck("var"); this.appendDummyInput() .appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET + Blockly.Msg.MIXLY_ESP32_SENOR_GYRO) @@ -767,7 +767,7 @@ export const sensor_mpu9250_calibrate_compass = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("MPU9250") + .appendField(Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250") .setCheck("var"); this.appendDummyInput() .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_CALIBRATE_COMPASS) @@ -783,7 +783,7 @@ export const sensor_mpu9250_temperature = { init: function () { this.setColour(SENSOR_EXTERN_HUE); this.appendValueInput('SUB') - .appendField("MPU9250") + .appendField(Blockly.Msg.MIXLY_NINE_AXIS_SENSOR+" MPU9250") .setCheck("var"); this.appendDummyInput() .appendField(Blockly.Msg.MIXLY_GETTEMPERATUE) diff --git a/boards/default_src/micropython/generators/sensor_extern.js b/boards/default_src/micropython/generators/sensor_extern.js index d83b5ce3..95978eba 100644 --- a/boards/default_src/micropython/generators/sensor_extern.js +++ b/boards/default_src/micropython/generators/sensor_extern.js @@ -181,7 +181,7 @@ export const sensor_use_i2c_init = function (_, generator) { code = v + ' = ltr381rgb.LTR_381RGB(' + iv + ')\n'; } else if(key == 'UCS12071'){ generator.definitions_['import_ucs12071'] = 'import ucs12071'; - ode = v + ' = ucs12071.UCS12071(' + iv + ')\n'; + code = v + ' = ucs12071.UCS12071(' + iv + ')\n'; } else if (key == 'LTR390UV'){ generator.definitions_['import_ltr390uv'] = 'import ltr390uv'; code = v + ' = ltr390uv.ALS_UVS(' + iv +')\n'; diff --git a/boards/default_src/micropython_esp32/template.xml b/boards/default_src/micropython_esp32/template.xml index da8a28ac..5b6c77c9 100644 --- a/boards/default_src/micropython_esp32/template.xml +++ b/boards/default_src/micropython_esp32/template.xml @@ -4128,7 +4128,7 @@ - radar + xsensor diff --git a/boards/default_src/micropython_esp32c2/template.xml b/boards/default_src/micropython_esp32c2/template.xml index 685117e1..b6f63183 100644 --- a/boards/default_src/micropython_esp32c2/template.xml +++ b/boards/default_src/micropython_esp32c2/template.xml @@ -3990,7 +3990,7 @@ - radar + xsensor diff --git a/boards/default_src/micropython_esp32c3/template.xml b/boards/default_src/micropython_esp32c3/template.xml index c581c47d..b21b22f9 100644 --- a/boards/default_src/micropython_esp32c3/template.xml +++ b/boards/default_src/micropython_esp32c3/template.xml @@ -3928,7 +3928,7 @@ - radar + xsensor diff --git a/boards/default_src/micropython_esp32s2/template.xml b/boards/default_src/micropython_esp32s2/template.xml index 32790f68..69f14e33 100644 --- a/boards/default_src/micropython_esp32s2/template.xml +++ b/boards/default_src/micropython_esp32s2/template.xml @@ -3721,7 +3721,7 @@ - radar + xsensor diff --git a/boards/default_src/micropython_esp32s3/template.xml b/boards/default_src/micropython_esp32s3/template.xml index 9cc151d6..4272290e 100644 --- a/boards/default_src/micropython_esp32s3/template.xml +++ b/boards/default_src/micropython_esp32s3/template.xml @@ -4360,7 +4360,7 @@ - radar + xsensor