From ca51aa8684e7300b9d6af8e89f0417f65e74a436 Mon Sep 17 00:00:00 2001 From: Irene-Maxine <114802521+Irene-Maxine@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:16:12 +0800 Subject: [PATCH] =?UTF-8?q?ucs12071=E3=80=81spl=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boards/default_src/micropython/blocks/sensor_extern.js | 2 ++ .../default_src/micropython/generators/sensor_extern.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/boards/default_src/micropython/blocks/sensor_extern.js b/boards/default_src/micropython/blocks/sensor_extern.js index 881c9c7d..ec72a4ef 100644 --- a/boards/default_src/micropython/blocks/sensor_extern.js +++ b/boards/default_src/micropython/blocks/sensor_extern.js @@ -347,8 +347,10 @@ export const sensor_use_i2c_init = { ["ADXL345", "ADXL345"], ["LTR308", "LTR308"], ["LTR381RGB", "LTR381RGB"], + ["UCS12071","UCS12071"], ["LTR390UV","LTR390UV"], ["HP203X", "HP203X"], + ["SPL06_001","SPL06_001"], ["SHTC3", "SHTC3"], ["AHT21", "AHT21"], ["VL53L0X", "VL53L0X"], diff --git a/boards/default_src/micropython/generators/sensor_extern.js b/boards/default_src/micropython/generators/sensor_extern.js index 40e00d0a..137e26ff 100644 --- a/boards/default_src/micropython/generators/sensor_extern.js +++ b/boards/default_src/micropython/generators/sensor_extern.js @@ -179,12 +179,18 @@ export const sensor_use_i2c_init = function (_, generator) { } else if (key == 'LTR381RGB') { generator.definitions_['import_ltr381rgb'] = 'import ltr381rgb'; code = v + ' = ltr381rgb.LTR_381RGB(' + iv + ')\n'; - }else if (key == 'LTR390UV'){ + } else if(key == 'UCS12071'){ + generator.definitions_['import_ucs12071'] = 'import ucs12071'; + ode = v + ' = ucs12071.UCS1207(' + iv + ')\n'; + } else if (key == 'LTR390UV'){ generator.definitions_['import_ltr390uv'] = 'import ltr390uv'; code = v + ' = ltr390uv.ALS_UVS(' + iv +')\n'; } else if (key == 'HP203X') { generator.definitions_['import_hp203x'] = 'import hp203x'; code = v + ' = hp203x.HP203X(' + iv + ')\n'; + } else if(key == "SPL06_001"){ + generator.definitions_['import_spl06_001'] = 'import spl06_001'; + code = v + ' = spl06_001.SPL06(' + iv + ')\n'; } else if (key == 'SHTC3') { generator.definitions_['import_shtc3'] = 'import shtc3'; code = v + ' = shtc3.' + key + "(" + iv + ')\n';