From 94b27ce04461cf1059f1abe887267978c224815e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=8D=A3?= <1595243018@qq.com> Date: Thu, 28 Nov 2024 13:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20maqueen.ts,=20=5Flocales/z?= =?UTF-8?q?h-cn/maqueen-strings.json,=20=5Flocales/zh-tw/maqueen-strings.j?= =?UTF-8?q?son,=20=5Flocales/pt/maqueen-strings.json,=20=5Flocales/fr/maqu?= =?UTF-8?q?een-strings.json,=20=5Flocales/es/maqueen-strings.json,=20=5Flo?= =?UTF-8?q?cales/nb/maqueen-strings.json,=20=5Flocales/ru/maqueen-strings.?= =?UTF-8?q?json,=20=5Flocales/ja/maqueen-strings.json,=20=5Flocales/zh-cn/?= =?UTF-8?q?maqueen-jsdoc-strings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _locales/es/maqueen-strings.json | 2 ++ _locales/fr/maqueen-strings.json | 2 ++ _locales/ja/maqueen-strings.json | 2 ++ _locales/nb/maqueen-strings.json | 4 +++- _locales/pt/maqueen-strings.json | 2 ++ _locales/ru/maqueen-strings.json | 2 ++ _locales/zh-cn/maqueen-jsdoc-strings.json | 2 ++ _locales/zh-cn/maqueen-strings.json | 2 ++ _locales/zh-tw/maqueen-strings.json | 2 ++ maqueen.ts | 10 ++++++++-- 10 files changed, 27 insertions(+), 3 deletions(-) diff --git a/_locales/es/maqueen-strings.json b/_locales/es/maqueen-strings.json index a0038d3..d3e05e7 100644 --- a/_locales/es/maqueen-strings.json +++ b/_locales/es/maqueen-strings.json @@ -53,6 +53,8 @@ "Maqueen_V5.DirectionType.Right|block": "Derecha", "Maqueen_V5.DirectionType.Left|block": "Izquierda", "Maqueen_V5.DirectionType.All|block": "Todos", + "Maqueen_V5.DirectionType2.Right|block": "Derecha", + "Maqueen_V5.DirectionType2.Left|block": "Izquierda", "Maqueen_V5.Motors.M1|block": "Izquierda", "Maqueen_V5.Motors.M2|block": "Derecha", "Maqueen_V5.Motors.All|block": "Todos", diff --git a/_locales/fr/maqueen-strings.json b/_locales/fr/maqueen-strings.json index e307d03..be805fb 100644 --- a/_locales/fr/maqueen-strings.json +++ b/_locales/fr/maqueen-strings.json @@ -58,6 +58,8 @@ "Maqueen_V5.DirectionType.Right|block": "Droite", "Maqueen_V5.DirectionType.Left|block": "Gauche", "Maqueen_V5.DirectionType.All|block": "Tout", + "Maqueen_V5.DirectionType2.Right|block": "Droite", + "Maqueen_V5.DirectionType2.Left|block": "Gauche", "Maqueen_V5.Motors.M1|block": "Côté gauche", "Maqueen_V5.Motors.M2|block": "Côté droit", "Maqueen_V5.Motors.All|block": "Tout", diff --git a/_locales/ja/maqueen-strings.json b/_locales/ja/maqueen-strings.json index 0688a41..1a8371c 100644 --- a/_locales/ja/maqueen-strings.json +++ b/_locales/ja/maqueen-strings.json @@ -69,6 +69,8 @@ "Maqueen_V5.DirectionType.Right|block": "右", "Maqueen_V5.DirectionType.Left|block": "左", "Maqueen_V5.DirectionType.All|block": "全て", + "Maqueen_V5.DirectionType2.Right|block": "右", + "Maqueen_V5.DirectionType2.Left|block": "左", "Maqueen_V5.Motors.M1|block": "左側", "Maqueen_V5.Motors.M2|block": "右側", "Maqueen_V5.Motors.All|block": "全て", diff --git a/_locales/nb/maqueen-strings.json b/_locales/nb/maqueen-strings.json index b3c6868..870ef60 100644 --- a/_locales/nb/maqueen-strings.json +++ b/_locales/nb/maqueen-strings.json @@ -56,7 +56,9 @@ "Maqueen_V5.bottomLedOff|block": "Slå av alle RGB bunner", "Maqueen_V5.DirectionType.Right|block": "Høyre", "Maqueen_V5.DirectionType.Left|block": "Venstre", - "Maqueen_V5.DirectionType.All|block": "Alle", + "Maqueen_V5.DirectionType.All|block": "Alle", + "Maqueen_V5.DirectionType2.Right|block": "Høyre", + "Maqueen_V5.DirectionType2.Left|block": "Venstre", "Maqueen_V5.Motors.M1|block": "Venstre", "Maqueen_V5.Motors.M2|block": "Høyre", "Maqueen_V5.Motors.All|block": "Alle", diff --git a/_locales/pt/maqueen-strings.json b/_locales/pt/maqueen-strings.json index c375ddf..e13a1d0 100644 --- a/_locales/pt/maqueen-strings.json +++ b/_locales/pt/maqueen-strings.json @@ -52,6 +52,8 @@ "Maqueen_V5.DirectionType.Right|block": "Direita", "Maqueen_V5.DirectionType.Left|block": "Esquerda", "Maqueen_V5.DirectionType.All|block": "Todas", + "Maqueen_V5.DirectionType2.Right|block": "Direita", + "Maqueen_V5.DirectionType2.Left|block": "Esquerda", "Maqueen_V5.Motors.M1|block": "Esquerdo", "Maqueen_V5.Motors.M2|block": "Direito", "Maqueen_V5.Motors.All|block": "Todos", diff --git a/_locales/ru/maqueen-strings.json b/_locales/ru/maqueen-strings.json index aa3fa2b..b120061 100644 --- a/_locales/ru/maqueen-strings.json +++ b/_locales/ru/maqueen-strings.json @@ -64,6 +64,8 @@ "Maqueen_V5.DirectionType.Right|block": "Право", "Maqueen_V5.DirectionType.Left|block": "Лево", "Maqueen_V5.DirectionType.All|block": "Все", + "Maqueen_V5.DirectionType2.Right|block": "Право", + "Maqueen_V5.DirectionType2.Left|block": "Лево", "Maqueen_V5.Motors.M1|block": "Левый", "Maqueen_V5.Motors.M2|block": "Правый", "Maqueen_V5.Motors.All|block": "Все", diff --git a/_locales/zh-cn/maqueen-jsdoc-strings.json b/_locales/zh-cn/maqueen-jsdoc-strings.json index 3c58fe8..00a4591 100644 --- a/_locales/zh-cn/maqueen-jsdoc-strings.json +++ b/_locales/zh-cn/maqueen-jsdoc-strings.json @@ -43,6 +43,8 @@ "Maqueen_V5.DirectionType.Right": "右", "Maqueen_V5.DirectionType.Left": "左", "Maqueen_V5.DirectionType.All": "全部", + "Maqueen_V5.DirectionType2.Right": "右", + "Maqueen_V5.DirectionType2.Left": "左", "Maqueen_V5.Motors.M1": "左侧", "Maqueen_V5.Motors.M2": "右侧", "Maqueen_V5.Motors.All": "全部", diff --git a/_locales/zh-cn/maqueen-strings.json b/_locales/zh-cn/maqueen-strings.json index 7d42f33..f9ba64f 100644 --- a/_locales/zh-cn/maqueen-strings.json +++ b/_locales/zh-cn/maqueen-strings.json @@ -63,6 +63,8 @@ "Maqueen_V5.DirectionType.Right|block": "右", "Maqueen_V5.DirectionType.Left|block": "左", "Maqueen_V5.DirectionType.All|block": "全部", + "Maqueen_V5.DirectionType2.Right|block": "右", + "Maqueen_V5.DirectionType2.Left|block": "左", "Maqueen_V5.Motors.M1|block": "左侧", "Maqueen_V5.Motors.M2|block": "右侧", "Maqueen_V5.Motors.All|block": "全部", diff --git a/_locales/zh-tw/maqueen-strings.json b/_locales/zh-tw/maqueen-strings.json index be82fd7..955613a 100644 --- a/_locales/zh-tw/maqueen-strings.json +++ b/_locales/zh-tw/maqueen-strings.json @@ -59,6 +59,8 @@ "Maqueen_V5.DirectionType.Right|block": "右", "Maqueen_V5.DirectionType.Left|block": "左", "Maqueen_V5.DirectionType.All|block": "全部", + "Maqueen_V5.DirectionType2.Right|block": "右", + "Maqueen_V5.DirectionType2.Left|block": "左", "Maqueen_V5.Motors.M1|block": "左側", "Maqueen_V5.Motors.M2|block": "右側", "Maqueen_V5.Motors.All|block": "全部", diff --git a/maqueen.ts b/maqueen.ts index c00f960..6889855 100644 --- a/maqueen.ts +++ b/maqueen.ts @@ -495,6 +495,12 @@ namespace Maqueen_V5 { All = 2, } + export enum DirectionType2 { + //% block="left led light" + Left = 0, + //% block="right led light" + Right = 1, + } export enum BatteryType { //% block="Alkaline battery" Alkaline = 1, @@ -996,9 +1002,9 @@ namespace Maqueen_V5 { //% block="Read Light Values %type" //% weight=16 //% group="Maqueen_v5" - export function readLightIntensity(type: DirectionType): number { + export function readLightIntensity(type: DirectionType2): number { let allBuffer = pins.createBuffer(2); - if (type == DirectionType.Left){ + if (type == DirectionType2.Left){ pins.i2cWriteNumber(I2CADDR, LIGHTL_H, NumberFormat.Int8LE); allBuffer = pins.i2cReadBuffer(I2CADDR, 2); return allBuffer[0] << 8 | allBuffer[1];