ucs12071、spl初始化

This commit is contained in:
Irene-Maxine
2024-10-21 10:16:12 +08:00
parent aa12c9d818
commit ca51aa8684
2 changed files with 9 additions and 1 deletions

View File

@@ -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"],

View File

@@ -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';