mryslab / s3onegpio Goto Github PK
View Code? Open in Web Editor NEWScratch 3 Extensions For Arduino, Circuit Playground Express, ESP-8266, Picoboard and Raspberry Pi
Scratch 3 Extensions For Arduino, Circuit Playground Express, ESP-8266, Picoboard and Raspberry Pi
// menus
const MENU_LIGHT_TEMPERATURE = {
'en': ['light', 'temperature'],
'zh-tw':['光線', '溫度'],
'zh-cn':['光线', '温度'],
'pt': ['luminosidade', 'temperatura'],
'pt-br': ['luminosidade', 'temperatura'],
'fr': ['lumière', 'température'],
'pl': ['światło', 'temperatura'],
'ja': ['光量', '温度'],
};
const MENU_PUSH_BUTTONS = {
'en': ['A', 'B'],
'zh-tw': ['A', 'B'],
'zh-cn': ['A', 'B'],
'pt': ['A', 'B'],
'pt-br': ['A', 'B'],
'fr': ['A', 'B'],
'pl': ['A', 'B'],
'ja': ['A', 'B'],
};
const MENU_PUSH_BUTTON_STATE = {
'en': ['pressed', 'released'],
'zh-tw': ['被按下', '被放開'],
'zh-cn': ['被按下', '被放开'],
'pt': ['pressionado', 'liberado'],
'pt-br': ['pressionado', 'liberado'],
'fr': ['appuyé', 'relaché'],
'pl': ["wciśnięty", "zwolniony"],
'ja': ["押下", "解放"],
};
const MENU_SLIDE_SWITCH_POSITION = {
'en': ['left', 'right'],
'zh-tw': ['左', '右'],
'zh-cn': ['左', '右'],
'pt': ['esquerda', 'direita'],
'pt-br': ['esquerda', 'direita'],
'fr': ['gauche', 'droite'],
'pl': ['lewo', 'prawo'],
'ja': ['左へ', '右へ'],
};
const MENU_TOUCH_PAD_STATES = {
'en': ['touched', 'released'],
'zh-tw': ['被按壓', '被放開'],
'zh-cn': ['被按压', '被放开'],
'pt': ['tocado', 'liberado'],
'pt-br': ['tocado', 'liberado'],
'fr': ['touché', 'relaché'],
'pl': ["dotknięty", "zwolniony"],
'ja': ["接触", "解放"],
};
const MENU_TILT_POSITION = {
'en': ['flat', 'up', 'down', 'left', 'right'],
'zh-tw': ['放平', '朝上', '朝下', '朝左', '朝右'],
'zh-cn': ['放平', '朝上', '朝下', '朝左', '朝右'],
'pt': ['plana', 'para cima', 'para baixo', 'para direita', 'para esquerda'],
'pt-br': ['plana', 'para cima', 'para baixo', 'para direita', 'para esquerda'],
'fr': ['horizontale', 'en haut', 'en bas', 'à gauche', 'à droite'],
'pl': ['płasko', 'w górę', 'w dół', 'w lewo', 'w prawo'],
'ja': ['水平', '上向', '下向', '左向', '右向'],
};
const MENU_BOARD_LED = {
'en': ['on', 'off'],
'zh-tw': ['亮', '暗'],
'zh-cn': ['亮', '暗'],
'pt': ['ligado', 'desligado'],
'pt-br': ['ligado', 'desligado'],
'fr': ['allumée', 'éteinte'],
'pl': ['włącz', 'wyłącz'],
'ja': ['点灯', '滅灯'],
};
// HAT BLOCK DESCRIPTORS
const HAT_BUTTONS = {
'en': 'When [BUTTON] is [PRESSED_RELEASED]',
'zh-tw': '當 [BUTTON] [PRESSED_RELEASED]',
'zh-cn': '当 [BUTTON] [PRESSED_RELEASED]',
'pt': 'Quando o botão [BUTTON] estiver [PRESSED_RELEASED]',
'pt-br': 'Quando o botão [BUTTON] estiver [PRESSED_RELEASED]',
'fr': 'si [BUTTON] est [PRESSED_RELEASED]',
'pl': 'Kiedy [BUTTON] jest [PRESSED_RELEASED]',
'ja': '[BUTTON] が [PRESSED_RELEASED] のとき',
};
const HAT_SLIDE_SWITCH = {
'en': 'When slide switch is moved [LEFT_RIGHT]',
'zh-tw': '當開關朝向 [LEFT_RIGHT]',
'zh-cn': '当开关朝向 [LEFT_RIGHT]',
'pt': 'Quando o botão switch mover para [LEFT_RIGHT]',
'pt-br': 'Quando o botão switch mover para [LEFT_RIGHT]',
'fr': "Si l'interrupteur à glissière est déplacé à [LEFT_RIGHT]",
'pl': "kiedy suwak jest przesunięty w [LEFT_RIGHT]",
'ja': "つまみスイッチが [LEFT_RIGHT] 動かされたとき",
};
const HAT_LIGHT_TEMPERATURE = {
'en': 'When [SENSOR] [COMPARISON] [VALUE]',
'zh-tw': '當 [SENSOR] [COMPARISON] [VALUE]',
'zh-cn': '当 [SENSOR] [COMPARISON] [VALUE]',
'pt': 'Quando [SENSOR] [COMPARISON] [VALUE]',
'pt-br': 'Quando [SENSOR] [COMPARISON] [VALUE]',
'fr': 'si [SENSOR] [COMPARISON] [VALUE]',
'pl': 'Kiedy [SENSOR] [COMPARISON] [VALUE]',
'ja': '[SENSOR] が [COMPARISON] [VALUE] のとき',
};
const HAT_TILTED = {
'en': 'When CPX position is [TILT_POSITION]',
'zh-tw': '當燈板 [TILT_POSITION]',
'zh-cn': '当灯板 [TILT_POSITION]',
'pt': 'Quando a CPX estiver [TILT_POSITION]',
'pt-br': 'Quando a CPX estiver na posição [TILT_POSITION]',
'fr': 'Si la carte CPX est [TILT_POSITION]',
'pl': 'Kiedy pozycja CPX jest [TILT_POSITION]',
'ja': 'CPX の姿勢が [TILT_POSITION] のとき',
};
const HAT_LOUD_SOUND = {
'en': 'When a loud sound is detected',
'zh-tw': '當偵測到聲音',
'zh-cn': '当侦测到声音',
'pt': 'Quando um som alto for detectado',
'pt-br': 'Quando um som alto for detectado',
'fr': 'Si un son fort est détecté',
'pl': 'Kiedy wykryto głośny dźwięk',
'ja': '大音量が検出されたとき',
};
const HAT_TOUCHPAD = {
'en': 'When touchpad [TOUCHPAD] is [TOUCH_STATE]',
'zh-tw': '當連接腳位 [TOUCHPAD] [TOUCH_STATE]',
'zh-cn': '当连接脚位 [TOUCHPAD] [TOUCH_STATE]',
'pt': 'Quando o touchpad [TOUCHPAD] for [TOUCH_STATE]',
'pt-br': 'Quando o touchpad [TOUCHPAD] for [TOUCH_STATE]',
'fr': 'Si le touchpad [TOUCHPAD] est [TOUCH_STATE]',
'pl': 'Kiedy panel dotykowy [TOUCHPAD] jest [TOUCH_STATE]',
'ja': 'タッチパッド [TOUCHPAD] が [TOUCH_STATE] のとき',
};
// boolean blocks
const BOOL_AB_SWITCH = {
'en': '[BUTTON] [PRESSED_RELEASED]',
'zh-tw': '[BUTTON] [PRESSED_RELEASED]',
'zh-cn': '[BUTTON] [PRESSED_RELEASED]',
'pt': '[BUTTON] [PRESSED_RELEASED]',
'pt-br': '[BUTTON] [PRESSED_RELEASED]',
'fr': '[BUTTON] [PRESSED_RELEASED]',
'pl': '[BUTTON] [PRESSED_RELEASED]',
'ja': '[BUTTON] が [PRESSED_RELEASED]',
};
const BOOL_SLIDE_SWITCH = {
'en': 'slide switch on the [LEFT_RIGHT]',
'zh-tw': '開關朝向 [LEFT_RIGHT]',
'zh-cn': '开关朝向 [LEFT_RIGHT]',
'pt': 'slide switch on the [LEFT_RIGHT]',
'pt-br': 'slide switch on the [LEFT_RIGHT]',
'fr': 'interrupteur à glissière à [LEFT_RIGHT]',
'pl': 'suwak na [LEFT_RIGHT]',
'ja': '[LEFT_RIGHT] のつまみスイッチ',
};
const BOOL_LIGHT_TEMP = {
'en': '[SENSOR] is [COMPARISON] [VALUE]',
'zh-tw': '[SENSOR] [COMPARISON] [VALUE]',
'zh-cn': '[SENSOR] [COMPARISON] [VALUE]',
'pt': '[SENSOR] for [COMPARISON] [VALUE]',
'pt-br': '[SENSOR] for [COMPARISON] [VALUE]',
'fr': '[SENSOR] est [COMPARISON] [VALUE]',
'pl': '[SENSOR] jest [COMPARISON] [VALUE]',
'ja': '[SENSOR] が [COMPARISON] [VALUE]',
};
const BOOL_TILTED = {
'en': 'CPX position is [TILT_POSITION]',
'zh-tw': '燈板 [TILT_POSITION]',
'zh-cn': '灯板 [TILT_POSITION]',
'pt': 'posição da CPX for [TILT_POSITION]',
'pt-br': 'posição da CPX for [TILT_POSITION]',
'fr': 'La carte CPX est [TILT_POSITION]',
'pl': 'pozycja CPX jest [TILT_POSITION]',
'ja': 'CPX の姿勢が [TILT_POSITION]',
};
const BOOL_TOUCH_PAD = {
'en': 'touchpad [TOUCHPAD] is [TOUCH_STATE]',
'zh-tw': '連接腳位 [TOUCHPAD] [TOUCH_STATE]',
'zh-cn': '连接脚位 [TOUCHPAD] [TOUCH_STATE]',
'pt': 'touchpad [TOUCHPAD] for [TOUCH_STATE]',
'pt-br': 'touchpad [TOUCHPAD] for [TOUCH_STATE]',
'fr': 'le touchpad [TOUCHPAD] est [TOUCH_STATE]',
'pl': 'panel dotykowy [TOUCHPAD] jest [TOUCH_STATE]',
'ja': 'タッチパッド [TOUCHPAD] が [TOUCH_STATE]',
};
const REPORTER_AB_SWITCH = {
'en': 'Button [BUTTON]',
'zh-tw': '按鈕 [BUTTON]',
'zh-cn': '按钮 [BUTTON]',
'pt': 'Botão [BUTTON]',
'pt-br': 'Botão [BUTTON]',
'fr': 'Bouton [BUTTON]',
'pl': 'Przycisk [BUTTON]',
'ja': 'ボタン [BUTTON]',
};
const REPORTER_SLIDE_SWITCH = {
'en': 'Slide switch',
'zh-tw': '開關',
'zh-cn': '开关',
'pt': 'botão switch',
'pt-br': 'botão switch',
'fr': 'Interrupteur à glissière',
'pl': 'Suwak',
'ja': 'つまみスイッチ',
};
const REPORTER_LIGHT_TEMP = {
'en': '[SENSOR]',
'zh-tw': '[SENSOR]',
'zh-cn': '[SENSOR]',
'pt': '[SENSOR]',
'pt-br': '[SENSOR]',
'fr': '[SENSOR]',
'pl': '[SENSOR]',
'ja': '[SENSOR]',
};
const REPORTER_TILT = {
'en': 'CPX position is [TILT_POSITION]',
'zh-tw': '燈板 [TILT_POSITION]',
'zh-cn': '灯板 [TILT_POSITION]',
'pt': 'posição da CPX [TILT_POSITION]',
'pt-br': 'posição da CPX [TILT_POSITION]',
'fr': 'La carte CPX est [TILT_POSITION]',
'pl': 'pozycja CPX jest [TILT_POSITION]',
'ja': 'CPX の姿勢が [TILT_POSITION]',
};
const REPORTER_TOUCHPAD = {
'en': 'touchpad [TOUCHPAD]',
'zh-tw': '連接腳位 [TOUCHPAD]',
'zh-cn': '连接脚位 [TOUCHPAD]',
'pt': 'touchpad [TOUCHPAD]',
'pt-br': 'touchpad [TOUCHPAD]',
'fr': 'le touchpad [TOUCHPAD]',
'pl': 'płytka dotykowa [TOUCHPAD]',
'ja': 'タッチパッド [TOUCHPAD]',
};
// command blocks
const COMMAND_SET_PIXEL = {
'en': 'Pixel [NEOPIXEL] R [RED] G [GREEN] B [BLUE]',
'zh-tw': '全彩LED [NEOPIXEL] 紅 [RED] 綠 [GREEN] 藍 [BLUE]',
'zh-cn': '全彩LED [NEOPIXEL] 红 [RED] 绿 [GREEN] 蓝 [BLUE]',
'pt': 'Pixel [NEOPIXEL] R [RED] G [GREEN] B [BLUE]',
'pt-br': 'Pixel [NEOPIXEL] R [RED] G [GREEN] B [BLUE]',
'fr': 'Pixel [NEOPIXEL] R [RED] V [GREEN] B [BLUE]',
'pl': 'Pixel [NEOPIXEL] R [RED] G [GREEN] B [BLUE]',
'ja': 'カラー LED [NEOPIXEL] を R [RED] G [GREEN] B [BLUE] に',
};
const COMMAND_TONE = {
'en': 'Tone [FREQ] Hz [DURATION] ms',
'zh-tw': '播放音調 [FREQ] 赫茲 [DURATION] 毫秒',
'zh-cn': '播放音调 [FREQ] 赫兹 [DURATION] 毫秒',
'pt': ' Criar com com [FREQ] Hz e [DURATION] ms',
'pt-br': ' Criar com com [FREQ] Hz e [DURATION] ms',
'fr': 'Son [FREQ] Hz [DURATION] ms',
'pl': 'Dźwięk [FREQ] Hz [DURATION] ms',
'ja': '音調を [FREQ] Hz [DURATION] ms に',
};
const COMMAND_BOARD_LED = {
'en': 'Board LED [LED_STATE]',
'zh-tw': 'D13 LED [LED_STATE]',
'zh-cn': 'D13 LED [LED_STATE]',
'pt': 'Definir Led da placa como [LED_STATE]',
'pt-br': 'Definir Led da placa como [LED_STATE]',
'fr': 'LED D13 [LED_STATE]',
'pl': 'Dioda LED płytki [LED_STATE]',
'ja': 'ボード LED を [LED_STATE] に',
};
const FormWSClosed = {
'en': "WebSocket Connection Is Closed.",
'zh-tw': "硬體連線中斷",
'zh-cn': "硬件联机中断",
'pt': "A Conexão do WebSocket está fechada.",
'pt-br': "A Conexão do WebSocket está fechada.",
'fr': "La connexion au WebSocket est fermée.",
'pl': "Połączenie WebSocket jest zamknięte.",
'ja': "ウェブソケット接続が切断されています",
};
Hello
here are 2 files with french translation
i will receive very soon the board and will improve translation when doing tests
best regards
françois
playground_express.txt
picoboard.txt
Hi,
I added lines for the German translation of each block.
regards
@christianimmler
Not sure if this project is still maintained but I wanted to report that when working on Firefox, I didn't find a way to open project from file. It just do nothing. No errors in JS console, nothing. It works however in Edge (I don't have Chrome to test).
It means every time I start the page I have to recreate project from scratch (pun not intended).
Tested on off line version (from this repository) and on online version https://mryslab.github.io/s3onegpio/
Firefox: 117
Windows 10
Do you have this on your radar? I'd like to start a project elementary age kids which combines a story with various Scratch programming steps to solve problems, create physical control elements and help get an astronaut closer to getting back to Earth. I found I can use Scratch 3 on the default Raspbian to turn on/off LEDs and read switches and voltages but I can not control servo motors or DC motors. The venerable PCA9685 is in many devices and there's even a rPi hat with 16 channels for ~$10. For ~$20 there's a rPi hat with the PCA9685 and an h-bridge.
Besides the full story, what's missing is the Servo control over I2C. I did find a board called PivoPi which has Scratch 2 support but I'm shooting for Scratch 3 so I've just started to read "How to Develop Your Own Block for Scratch 3.0". Thanks.
Actually doing some first steps with a Raspberry Pico and your great scratch one GPIO extension. Settings digital pins an doing blinking for example works fine, but using read digital pin leads to immediate cloding of the websocketServer because s3rp exits with signal 0:
PS C:\Users\Lucy> s3rp
backplane started
Websocket Gateway started
RPi Pico Gateway started
To exit this program, press Control-c
Websocket Gateway exited...
Exception ignored in atexit callback: <bound method S3RP.killall of <s3_extend.s3rp.S3RP object at 0x0000017408FC4230>>
Traceback (most recent call last):
File "C:\Users\Lucy\AppData\Local\Programs\Python\Python312\Lib\site-packages\s3_extend\s3rp.py", line 141, in killall
sys.exit(0)
SystemExit: 0
PS C:\Users\Lucy>
See screenshot for actual program.
python, pip and s3extend are up to date. What i find curiuos is that the screenshot in your manual is not matching the acual scratch command - the option to configure the pullup resistor is missing. May this be the problem?
Anything I can do beeing a python noop to assist in debugging?
Bye and a happy new year
Simon
Hi Alan, I am doing some test with PWM and sometimes receive a message "WebSocket Connection Is Closed" To leave this need to refresh the browser.
Is there a way to reestablish the connection without refresh the browser - once we loose what we are doing?
Adding a button like you placed in previous version?
Or any other trick...
Thanks!
Edson Sobreira
Thanks for your adoption of my proposals about Japanese translation of "playground_express (onegpioCpx)", etc.
By the way, "translations" is adopted for "onegpioEsp" but not for "onegpioRpi" and "onegpioArduino".
Are there any unsuitable points in "translations"?
This is only a suggestion and needs no response.
I hope a simple installation procedure for Windows 10 which do not depend on WSL so that more people use "Scratch3 Extension For GPIO Control".
I finished such a procedure. Now in Windows cmd, I can simply start the Scratch 3 with S3OneGPIO to run Scratch scripts to control Raspi GPIO pins with s3r over WiFi connection.
Surely, the current formal procedure "Creating a Scratch3 Extension For GPIO Control - Part 1" works well for WSL. But WSL is complicated and bothering. WSL may be useful for developmental works on Windows 10. Nevertheless, for that purpose Linux serves far more. In addition, WSL is never necessary for the use of Scratch itself. For traditional Windows 10 users, Power Shell will be more useful than WSL for developmental works.
For a reference, I describe the outline of my procedure which roughly follows the current formal one. It does not use WSL at all and does not use Power Shell in direct.
I downloaded all installation files from their original sites with a browser and executed or expanded them only with Windows Explorer.
1-1. Nodejs and npm
1-2. Yarn
1-3. Git
1-4. A copy of scratch-vm and scratch-gui
https://github.com/MrYsLab/s3onegpio/
I executed all commands in not elevated Windows cmd.
Although the initial installation, I followed the "rebuilding_and_rerunning.txt" of:
https://github.com/MrYsLab/s3onegpio/blob/master/notes/rebuilding_and_rerunning.txt
That's all. It's simple and easy.
About the installation of s3r, I shall write another issue.
My environment is the following:
Windows 10 Pro 64bit Japanese Version (Version 20H2, build 19042.685)
(a virtual machine in VirtualBox 6.1.16, hosted on Solaris 11.3)
node : v14.15.
npm : 6.14.10
yarn : 1.22.5
git : 2.30.0.windows.1
By the way, the Japanese national curriculum of Information processing for elementary schools adopted Scratch 3 as one of must educational materials on 2020. I hope that Japanese users of S3OneGPIO will increase with simple installation procedures for Windows and with Japanized Scratch blocks. I regret that in Japan Windows is overwhelmingly dominant but Linux is very minor.
My grandson (13 years old) and I are going to build Scratch scripts to control and self-drive our own toy cars which are based on Raspi. For that purpose, S3OneGPIO is the best and only one programming environment.
Thanks S3OneGPIO!
// common
const FormDigitalWrite = {
'pt-br': 'Escrever Pino Digital[PIN]como[ON_OFF]',
'pt': 'Escrever Pino Digital[PIN]como[ON_OFF]',
'en': 'Write Digital Pin [PIN] [ON_OFF]',
'fr': 'Mettre la pin numérique[PIN]à[ON_OFF]',
'zh-tw': '腳位[PIN]數位輸出[ON_OFF]',
'zh-cn': '脚位[PIN]数位输出[ON_OFF]',
'pl': 'Ustaw cyfrowy Pin [PIN] na [ON_OFF]',
'ja': 'デジタル・ピン [PIN] に [ON_OFF] を出力',
};
const FormIPBlockR = {
'pt-br': 'Endereço IP do RPi [IP_ADDR]',
'pt': 'Endereço IP do RPi [IP_ADDR]',
'en': 'Remote IP Address [IP_ADDR]',
'fr': 'Adresse IP du RPi [IP_ADDR]',
'zh-tw': '遠端 IP 位址[IP_ADDR]',
'zh-cn': '远程 IP 地址[IP_ADDR]',
'pl': 'Adres IP Rasberry Pi [IP_ADDR]',
'ja': 'Robo HAT の IP アドレスを [IP_ADDR] に',
};
const FormPwmWrite = {
'pt-br': 'Escrever Pino PWM[PIN]com[VALUE]%',
'pt': 'Escrever Pino PWM[PIN]com[VALUE]%',
'en': 'Write PWM Pin [PIN] [VALUE]%',
'fr': 'Mettre la pin PWM[PIN]à[VALUE]%',
'zh-tw': '腳位[PIN]類比輸出[VALUE]%',
'zh-cn': '脚位[PIN]类比输出[VALUE]%',
'pl': 'Ustaw PWM Pin [PIN] na [VALUE]%',
'ja': 'PWM ピン [PIN] に [VALUE]% を出力',
};
const FormServo = {
'pt-br': 'Mover Servo Motor no[PIN]para[ANGLE]°',
'pt': 'Mover Servo Motor no[PIN]para[ANGLE]°',
'en': 'Write Servo Pin [PIN] [ANGLE] Deg.',
'fr': 'Mettre le servo[PIN]à[ANGLE] Deg.',
'zh-tw': '伺服馬達腳位[PIN]轉動角度到[ANGLE]度',
'zh-cn': '伺服马达脚位[PIN]转动角度到[ANGLE]度',
'pl': 'Ustaw silnik servo na Pinie [PIN] na [ANGLE]°',
'ja': 'サーボ・ピン [PIN] に [ANGLE] 度を出力',
};
const FormAnalogRead = {
'pt-br': 'Ler Pino Analógico [PIN]',
'pt': 'Ler Pino Analógico [PIN]',
'en': 'Read Analog Pin [PIN]',
'fr': 'Lecture analogique [PIN]',
'zh-tw': '讀取類比腳位[PIN]',
'zh-cn': '读取类比脚位[PIN]',
'pl': 'Odczytaj analogowy Pin [PIN]',
'ja': 'アナログ・ピン [PIN] から入力',
};
const FormDigitalRead = {
'pt-br': 'Ler Pino Digital [PIN]',
'pt': 'Ler Pino Digital [PIN]',
'en': 'Read Digital Pin [PIN]',
'fr': 'Lecture numérique [PIN]',
'zh-tw': '讀取數位腳位[PIN]',
'zh-cn': '读取数位脚位[PIN]',
'pl': 'Odczytaj cyfrowy Pin [PIN]',
'ja': 'デジタル・ピン [PIN] から入力',
};
const FormMPURead = {
'pt-br': 'Ler MPU [MODE]',
'pt': 'Ler MPU [MODE]',
'en': 'Read MPU [MODE]',
'fr': 'Lecture MPU [MODE]',
'zh-tw': '讀取 MPU [MODE]',
'zh-cn': '讀取 MPU [MODE]',
'pl': 'Odczytaj MPU [MODE]',
'ja': 'MPU の [MODE] から入力',
};
const FormINARead = {
'pt-br': 'Ler INA [MODE]',
'pt': 'Ler INA [MODE]',
'en': 'Read INA [MODE]',
'fr': 'Lecture INA [MODE]',
'zh-tw': '讀取 INA [MODE]',
'zh-cn': '讀取 INA [MODE]',
'pl': 'Odczytaj INA [MODE]',
'ja': 'INA の [MODE] から入力',
};
const FormAxRead = {
'pt-br': 'Read Accelerometer X Axis',
'pt': 'Read Accelerometer X Axis',
'en': 'Read Accelerometer X Axis',
'fr': 'Read Accelerometer X Axis',
'zh-tw': 'Read Accelerometer X Axis',
'zh-cn': 'Read Accelerometer X Axis',
'pl': 'Read Accelerometer X Axis',
'ja': '加速度計の X 軸から入力',
};
const FormAyRead = {
'pt-br': 'Read Accelerometer Y Axis',
'pt': 'Read Accelerometer Y Axis',
'en': 'Read Accelerometer Y Axis',
'fr': 'Read Accelerometer Y Axis',
'zh-tw': 'Read Accelerometer Y Axis',
'zh-cn': 'Read Accelerometer Y Axis',
'pl': 'Read Accelerometer Y Axis',
'ja': '加速度計の Y 軸から入力',
};
const FormAzRead = {
'pt-br': 'Read Accelerometer Z Axis',
'pt': 'Read Accelerometer Z Axis',
'en': 'Read Accelerometer Z Axis',
'fr': 'Read Accelerometer Z Axis',
'zh-tw': 'Read Accelerometer Z Axis',
'zh-cn': 'Read Accelerometer Z Axis',
'pl': 'Read Accelerometer Z Axis',
'ja': '加速度計の Z 軸から入力',
};
const FormGxRead = {
'pt-br': 'Read Gyroscope X Axis',
'pt': 'Read Gyroscope X Axis',
'en': 'Read Gyroscope X Axis',
'fr': 'Read Gyroscope X Axis',
'zh-tw': 'Read Gyroscope X Axis',
'zh-cn': 'Read Gyroscope X Axis',
'pl': 'Read Gyroscope X Axis',
'ja': '方位計の X 軸から入力',
};
const FormGyRead = {
'pt-br': 'Read Gyroscope Y Axis',
'pt': 'Read Gyroscope Y Axis',
'en': 'Read Gyroscope Y Axis',
'fr': 'Read Gyroscope Y Axis',
'zh-tw': 'Read Gyroscope Y Axis',
'zh-cn': 'Read Gyroscope Y Axis',
'pl': 'Read Gyroscope Y Axis',
'ja': '方位計の Y 軸から入力',
};
const FormGzRead = {
'pt-br': 'Read Gyroscope Z Axis',
'pt': 'Read Gyroscope Z Axis',
'en': 'Read Gyroscope Z Axis',
'fr': 'Read Gyroscope Z Axis',
'zh-tw': 'Read Gyroscope Z Axis',
'zh-cn': 'Read Gyroscope Z Axis',
'pl': 'Read Gyroscope Z Axis',
'ja': '方位計の Z 軸から入力',
};
const FormSonarRead = {
'pt-br': 'Ler Distância: Sonar em T[TRIGGER_PIN] E[ECHO_PIN]',
'pt': 'Ler Distância: Sonar em T[TRIGGER_PIN] E[ECHO_PIN]',
'en': 'Read SONAR T [TRIGGER_PIN] E [ECHO_PIN]',
'fr': 'Distance de lecture : Sonar T [TRIGGER_PIN] E [ECHO_PIN]',
'zh-tw': 'HCSR超音波感測器,Echo在腳位[ECHO_PIN]Trig在腳位[TRIGGER_PIN]',
'zh-cn': 'HCSR超音波感测器,Echo在脚位[ECHO_PIN]Trig在脚位[TRIGGER_PIN]',
'pl': 'Odczytaj odległość: Sonar T [TRIGGER_PIN] E [ECHO_PIN]',
'ja': '超音波測距器からトリガ・ピン [TRIGGER_PIN] とエコー・ピン [ECHO_PIN] で入力',
};
// General Alert
const FormWSClosed = {
'pt-br': "A Conexão do WebSocket está Fechada",
'pt': "A Conexão do WebSocket está Fechada",
'en': "WebSocket Connection Is Closed.",
'fr': "La connexion WebSocket est fermée.",
'zh-tw': "網路連線中斷",
'zh-cn': "网絡连线中断",
'pl': "Połączenie WebSocket jest zamknięte.",
'ja': "ウェブソケット接続が切断されています",
};
Hi!
The current version of S3OneGPIO fails to compile by "yarn start".
The failing version of s3onegpio-master.zip was downloaded (Code > Download) on 2021/05/12.
Versions downloaded on 2021/05/08 and 2021/03/19 are OK.
System environment:
Microsoft Windows 10 Pro
10.0.19042 build 19042
node v14.17.0
npm 6.14.13
yarn 1.22.5
git version 2.31.1.windows.1
Build procedureg:
cd C:\Users%USERNAME%\s3onegpio-master\scratch-gui
yarn unlink scratch-vm
cd C:\Users%USERNAME%\s3onegpio-master\scratch-vm
yarn unlink
yarn --force install
yarn link
cd C:\Users%USERNAME%\s3onegpio-master\scratch-gui
yarn link scratch-vm
yarn --force install
yarn start
Extracted log (after "yarn start"):
yarn run v1.22.5
warning ....\package.json: No license field
$ webpack-dev-server
i 「wds」: Project is running at http://0.0.0.0:8601/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\kh\s3onegpio-master\scratch-gui\build
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
(node:10424) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
(Use node --trace-deprecation ...
to show where the warning was created)
× 「wdm」: Hash: 92e7e1c762f213e86e09
Version: webpack 4.44.2
Child
Hash: 92e7e1c762f213e86e09
Time: 41325ms
Built at: 2021/05/13 10:49:20
Asset Size Chunks Chunk Names
326c5f98902ccd335b5b.worker.js 6.44 KiB [emitted] [immutable]
326c5f98902ccd335b5b.worker.js.map 6.32 KiB [emitted] [dev]
blocks-only.html 456 bytes [emitted]
...
...
static/extensions/example-extension.js 9.76 KiB [emitted]
static/favicon.ico 33.7 KiB [emitted]
Entrypoint gui = lib.min.js lib.min.js.map chunks/gui.js chunks/gui.js.map
Entrypoint blocksonly = lib.min.js lib.min.js.map chunks/blocksonly.js chunks/blocksonly.js.map
Entrypoint compatibilitytesting = lib.min.js lib.min.js.map chunks/compatibilitytesting.js chunks/compatibilitytesting.js.map
Entrypoint player = lib.min.js lib.min.js.map chunks/player.js chunks/player.js.map
[0] multi (webpack)-dev-server/client?http://0.0.0.0:8601 react react-dom 52 bytes {lib.min} [built]
[2] multi (webpack)-dev-server/client?http://0.0.0.0:8601 ./src/playground/index.jsx 40 bytes {gui} [built]
[12] multi (webpack)-dev-server/client?http://0.0.0.0:8601 ./src/playground/blocks-only.jsx 40 bytes {blocksonly} [built]
[13] multi (webpack)-dev-server/client?http://0.0.0.0:8601 ./src/playground/compatibility-testing.jsx 40 bytes {compatibilitytesting} [built]
[14] multi (webpack)-dev-server/client?http://0.0.0.0:8601 ./src/playground/player.jsx 40 bytes {player} [built]
[./node_modules/classnames/index.js] 1.17 KiB {lib.min} [built]
[./node_modules/core-js/fn/array/includes.js] 109 bytes {lib.min} [built]
[./node_modules/core-js/fn/promise/finally.js] 166 bytes {lib.min} [built]
[./node_modules/react-dom/index.js] 1.33 KiB {lib.min} [built]
[./node_modules/react/index.js] 190 bytes {lib.min} [built]
[./node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:8601] (webpack)-dev-server/client?http://0.0.0.0:8601 4.29 KiB {lib.min} [built]
[./src/playground/blocks-only.jsx] 1.09 KiB {blocksonly} [built]
[./src/playground/compatibility-testing.jsx] 4.96 KiB {compatibilitytesting} [built]
[./src/playground/index.jsx] 1.18 KiB {gui} [built]
[./src/playground/player.jsx] 2.57 KiB {player} [built]
+ 2140 hidden modules
ERROR in ./src/lib/libraries/extensions/index.jsx
Module not found: Error: Can't resolve './onegpioRpiPico/onegpioRpiPico-small.png' in 'C:\Users\kh\s3onegpio-master\scratch-gui\src\lib\libraries\extensions'
@ ./src/lib/libraries/extensions/index.jsx 51:0-83 326:16-42
@ ./src/containers/blocks.jsx
@ ./src/playground/blocks-only.jsx
ERROR in ./src/lib/libraries/extensions/index.jsx
Module not found: Error: Can't resolve './onegpioRpiPico/onegpioRpiPico.png' in 'C:\Users\kh\s3onegpio-master\scratch-gui\src\lib\libraries\extensions'
@ ./src/lib/libraries/extensions/index.jsx 50:0-70 325:11-30
@ ./src/containers/blocks.jsx
@ ./src/playground/blocks-only.jsx
Child html-webpack-plugin for "blocks-only.html":
1 asset
Entrypoint undefined = blocks-only.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/playground/index.ejs] 1.06 KiB {0} [built]
[./node_modules/lodash/lodash.js] 531 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
Child html-webpack-plugin for "compatibility-testing.html":
1 asset
Entrypoint undefined = compatibility-testing.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/playground/index.ejs] 1.06 KiB {0} [built]
[./node_modules/lodash/lodash.js] 531 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/playground/index.ejs] 1.06 KiB {0} [built]
[./node_modules/lodash/lodash.js] 531 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
Child html-webpack-plugin for "player.html":
1 asset
Entrypoint undefined = player.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/playground/index.ejs] 1.06 KiB {0} [built]
[./node_modules/lodash/lodash.js] 531 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
Child worker:
Asset Size Chunks Chunk Names
326c5f98902ccd335b5b.worker.js 6.44 KiB main [emitted] [immutable] main
326c5f98902ccd335b5b.worker.js.map 6.32 KiB main [emitted] [dev] main
Entrypoint main = 326c5f98902ccd335b5b.worker.js 326c5f98902ccd335b5b.worker.js.map
[./node_modules/babel-loader/lib/index.js?!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js] ./node_modules/babel-loader/lib??ref--4!./node_modules/scratch-storage/src/FetchWorkerTool.worker.js 2.24 KiB {main} [built]
Child worker:
Asset Size Chunks Chunk Names
extension-worker.js 55.8 KiB main [emitted] main
extension-worker.js.map 43.6 KiB main [emitted] [dev] main
Entrypoint main = extension-worker.js extension-worker.js.map
[./node_modules/babel-loader/lib/index.js?!./node_modules/scratch-vm/src/extension-support/extension-worker.js] ./node_modules/babel-loader/lib??ref--4!./node_modules/scratch-vm/src/extension-support/extension-worker.js 4.29 KiB {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/common/filter.js] 1.36 KiB {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/common/minilog.js] 1.55 KiB {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/web/array.js] 319 bytes {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/web/console.js] 925 bytes {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/web/index.js] 1.28 KiB {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/web/jquery_simple.js] 2.16 KiB {main} [built]
[./node_modules/scratch-vm/node_modules/minilog/lib/web/localstorage.js] 530 bytes {main} [built]
[./node_modules/scratch-vm/src/dispatch/shared-dispatch.js] 14.6 KiB {main} [built]
[./node_modules/scratch-vm/src/dispatch/worker-dispatch.js] 7.41 KiB {main} [built]
[./node_modules/scratch-vm/src/extension-support/argument-type.js] 605 bytes {main} [built]
[./node_modules/scratch-vm/src/extension-support/block-type.js] 1.02 KiB {main} [built]
[./node_modules/scratch-vm/src/extension-support/target-type.js] 308 bytes {main} [built]
[./node_modules/scratch-vm/src/util/log.js] 84 bytes {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {main} [built]
+ 5 hidden modules
i 「wdm」: Failed to compile.
[period]
Im curious of one thing, after making programing onto the Arduino, will i be able to use the Arduino on standalone basis? like when i disconnect the Arduino and externally power the Arduino will it behave as i coded it to via scratch?
Hell Alan,
thanks a lot for your work! So I wanted to use your documentation to add my extension in Scratch3 and it works, thanks a lot for your link to hiroyuki tuto. But if I copy needed files for s3onegpioArduino, for example, I have error in browser (Firefox 104, Ubuntu 64 bits) and maybe some code has changed in new version of Scratch.
It compiles with webpack and I can launch Scratch3, but when opening extension panel I have error "[React Intl] Missing message: "gui.extension.scratchhome.description" for locale: "fr", using default message as fallback.".
If I continue with Scratch in english of course this problem disappears, but when I select ongpioArduino extension in console I have this error:
Can you updates scratch-gui & scratch-vm please ?
Many thanks!
一但使用pwm的模块就网络中断。。。
Hello! 👋
I run a fork of Scratch 3 at https://machinelearningforkids.co.uk/scratch3/ which is Scratch + some extensions I've written to allow use of machine learning models.
I've had a request from a user who wants to use both of our extensions in a single project - an AI/ML project that controls an Arduino or Raspberry Pi.
Would you be happy for me to add a copy of your extensions from this repo into my fork as well?
(If you have any hesitation or concerns about this at all, please just say - and I wouldn't do it)
If Scratch tries to run any sort of Read, OneGPIO crashes and everything else stops working.
FYR RPi 4 + latest raspbian version provide scratch 3 build-in extensions
https://www.raspberrypi.org/blog/scratch-3-desktop-for-raspbian-on-raspberry-pi/
maybe it worth to have a reference and have some note about the same/different approaches
I'm using ESP8266 with Motor shield L293D with s3onegpio web serwer and scratch 3. I wonder if it is possible to set backwards rotation of the DC motor.
I can drive two wheel car with dc motors foreward but I have no idea how to set backwards rotation.
When trying to read ultrasonic sensor, Arduino board starts to receive commands from OneGPIO but never stops. This leads T/E ports to become unusable under Scratch and maybe a non-stop data sending from PC to Arduino.
On May 13, 2021, there are no improvements in RPi and Arduino extension.
The problem is confusions in index.js's of those extensions. The conflicts break parameter parts of extension blocks. For example of RPi:
Llines 613614, 635637:
_setLocale () {
let now_locale = '';
...
case 'ja':
now_locale='ja';
break;
Nevertheless, Lines 76~86 etc. have no 'ja' counterparts:
// common
const FormDigitalWrite = {
'pt-br': 'Escrever Pino Digital [PIN]como[ON_OFF]',
'pt': 'Escrever Pino Digital[PIN]como[ON_OFF]',
'en': 'Write Digital Pin [PIN] [ON_OFF]',
'fr': 'Mettre la pin numérique[PIN]à[ON_OFF]',
'zh-tw': '腳位[PIN]數位輸出[ON_OFF]',
'zh-cn': '脚位[PIN]数位输出[ON_OFF]',
'pl': 'Ustaw cyfrowy Pin [PIN] na [ON_OFF]',
'de': 'Setze digitalen Pin [PIN] [ON_OFF]',
};
I encountered a problem which makes hard somewhat the use of S3OneGPIO. First, I write a wanted fix.
"Extensions/scratch3_onegpioRpi/index.js" should incorporate some adequate initializations for pigpiod.
The problematic situation is introduced by starting a Scratch script which has some S3OneGPIO block "Read Digital Pin" from a GPIO pin which is set accidentally output state. This is incidental. As a matter of course, the Scratch script does not work. I can change the pin state to input with WebIOPi.
The problem is that I can not effectively restart the script even after common recovering operations. Following operations do not work: restarting the Scratch script with red and green flags, reloading the script from the computer, rereading the OneGPIO Web page, restarting the browser (Firefox and Chrome)
S3OneGPIO gets stuck in a bad condition. In the bad condition, the script receives no input signal at all from the pin now in appropriate input state. To tell the fact, no changing external signals do not arrive at any application programs which read the now input GPIO pin. I can certify that graphically with applications such as WebIOPi and piscope. By the way, I have no electrical means to read out the value of the pin.
The means with which I apply to get out of the bad S3OneGPIO condition is running a Python program in the server Raspi. The simple program uses the pigpio library and works equivalently as the Scratch script except for the additional initializing operations. I paste the program at last of this post. I run the program on Thonny,
The Python program never suffers the bad condition on the similarly accidental output state pin. When I start the program, it automatically changes the state of the pin from accidental output to appropriate input and runs successfully, This is the fact even when the Scratch script stays in in the bad condition.
The important matter is that after the successful run of the Python program, I can easily restart the failing Scratch script with red and green buttons in success. No other bothering recovering operations are necessary. Nevertheless Python programming and operations as well as WebIOPi are hard for casual Scratch users.
I think the Python program adequately initialize pigpiod though the current "Extensions/scratch3_onegpioRpi/index.js" fails to do so. S3OneGPIO has no initializing blocks unlike the Scratch 3 Desktop built in Raspbian Buster, which has a block "set gpio X to input ...".
For the reference my environment on RasPi is:
Raspberry Pi 3 B+
Raspbian Buster Linux pi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
Thonny 3.2.6-1+rpt1
Python 3.7.3
pigpio V71 (1.71-0~rpt1)
s3r &
rpi_gateway.py installed on 2020/10/22
S3OneGPIO downloaded on 2021/01/07
The Python program which does the equivalent thing as the Scratch script:
SW_PIN = 25
LED_PIN = 14
pi = pigpio.pi()
pi.set_mode( SW_PIN, pigpio.INPUT )
pi.set_pull_up_down( SW_PIN, pigpio.PUD_UP )
pi.set_mode( LED_PIN, pigpio.OUTPUT )
mode = 0
while True:
sw = pi.read( SW_PIN )
if ( sw == pigpio.LOW ):
if ( mode == 0 ):
pi.write( LED_PIN, pigpio.HIGH )
mode = 1
else:
pi.write( LED_PIN, pigpio.LOW )
mode = 0
while ( pi.read( SW_PIN ) == pigpio.LOW ):
time.sleep( 0.1 )
Hello, Alan,
The file attached contains zh-tw and zh-cn translations of playground_express.txt. Thank you!
Justina
I noticed that the read digital pin block just reads gpio current state and not a stream of data.
Is there a way I can read a sensor's data, such as temperature sensor, humidity sensor? They only require one GPIO data pin (apart from power and ground)
Hello,
Thank you very much for providing this extension to Scratch3! This is a great initiative.
When working with Scratch3 offline and an ESP8266, I am observing an unreliable connection which makes it almost impossible to exchange data.
I am using Telenetrux-ESP8266 firmware version 1.5 and the currently released version of s3e.
The ESP-8266 connects to the Wifi Network and the TCP server waits for connections. s3e seems to start and run happily.
I can see a connection coming in on the firmware side whenever I start the Scratch3 script ("Client connected to address:...".
In Wireshark I can see packets being exchanged between the ESP8266 and the Scratch3 script. So far, so good.
The first issue happens when I stop the Scratch3 script: the connection to the server does not appear to be detected as closed by the firmware. Even though the script is stopped, the firmware continues to report to the remote client, I can see packets being sent from the ESP-8266 to the client. The firmware only sees a closed connection when I manually stop s3e (ctrl+C). It looks like the "stop_reports" variable is not set on the firmware side, and the connection is not seen as closed as well.
The second issue is that when I stop the scratch script I am unable to communicate with the firmware again even though I start the Scratch script, and reinitialize the connection. I need to kill s3e, start it again, kill Scratch3 and start it again. This seems to be linked to the first issue, where the connection between the client and the server is not closed when the Scartch3 script stops.
Do you have an idea of what the issue might be, and how to fix it?
Regards,
JS
// common
const FormDigitalWrite = {
'pt-br': 'Escrever Pino Digital [PIN]como[ON_OFF]',
'pt': 'Escrever Pino Digital[PIN]como[ON_OFF]',
'en': 'Write Digital Pin [PIN] [ON_OFF]',
'fr': 'Mettre la pin numérique[PIN]à[ON_OFF]',
'zh-tw': '腳位[PIN]數位輸出[ON_OFF]',
'zh-cn': '脚位[PIN]数位输出[ON_OFF]',
'pl': 'Ustaw cyfrowy Pin [PIN] na [ON_OFF]',
'ja': 'デジタル・ピン [PIN] に [ON_OFF] を出力',
};
const FormPwmWrite = {
'pt-br': 'Escrever Pino PWM[PIN]com[VALUE]%',
'pt': 'Escrever Pino PWM[PIN]com[VALUE]%',
'en': 'Write PWM Pin [PIN] [VALUE]%',
'fr': 'Mettre la pin PWM[PIN]à[VALUE]%',
'zh-tw': '腳位[PIN]類比輸出[VALUE]%',
'zh-cn': '脚位[PIN]类比输出[VALUE]%',
'pl': 'Ustaw PWM Pin [PIN] na [VALUE]%',
'ja': 'PWM ピン [PIN] に [VALUE]% を出力',
};
const FormTone = {
'pt-br': 'Soar no Pino[PIN]com[FREQ]Hz e[DURATION]ms',
'pt': 'Soar no Pino[PIN]com[FREQ]Hz e[DURATION]ms',
'en': 'Tone Pin [PIN] [FREQ] Hz [DURATION] ms',
'fr': 'Définir le buzzer sur la pin[PIN]à[FREQ]Hz pendant[DURATION] ms',
'zh-tw': '腳位[PIN]播放音調,頻率為[FREQ]時間為[DURATION]',
'zh-cn': '脚位[PIN]播放音调,频率为[FREQ]时间为[DURATION]',
'pl': 'Ustaw brzęczyk na Pinie [PIN] na [FREQ] Hz i [DURATION] ms',
'ja': '音調ピン [PIN] を [FREQ] Hz [DURATION] ms に',
};
const FormServo = {
'pt-br': 'Mover Servo Motor no[PIN]para[ANGLE]°',
'pt': 'Mover Servo Motor no[PIN]para[ANGLE]°',
'en': 'Write Servo Pin [PIN] [ANGLE] Deg.',
'fr': 'Mettre le servo[PIN]à[ANGLE] Deg.',
'zh-tw': '伺服馬達腳位[PIN]轉動角度到[ANGLE]度',
'zh-cn': '伺服马达脚位[PIN]转动角度到[ANGLE]度',
'pl': 'Ustaw silnik servo na Pinie [PIN] na [ANGLE]°',
'ja': 'サーボ・ピン [PIN] に [ANGLE] 度を出力',
};
const FormAnalogRead = {
'pt-br': 'Ler Pino Analógico [PIN]',
'pt': 'Ler Pino Analógico [PIN]',
'en': 'Read Analog Pin [PIN]',
'fr': 'Lecture analogique [PIN]',
'zh-tw': '讀取類比腳位[PIN]',
'zh-cn': '读取类比脚位[PIN]',
'pl': 'Odczytaj analogowy Pin [PIN]',
'ja': 'アナログ・ピン [PIN] から入力',
};
const FormDigitalRead = {
'pt-br': 'Ler Pino Digital [PIN]',
'pt': 'Ler Pino Digital [PIN]',
'en': 'Read Digital Pin [PIN]',
'fr': 'Lecture numérique [PIN]',
'zh-tw': '讀取數位腳位[PIN]',
'zh-cn': '读取数位脚位[PIN]',
'pl': 'Odczytaj cyfrowy Pin [PIN]',
'ja': 'デジタル・ピン [PIN] から入力',
};
const FormSonarRead = {
'pt-br': 'Ler Distância: Sonar em T[TRIGGER_PIN] E[ECHO_PIN]',
'pt': 'Ler Distância: Sonar em T[TRIGGER_PIN] E[ECHO_PIN]',
'en': 'Read SONAR T [TRIGGER_PIN] E [ECHO_PIN]',
'fr': 'Distance de lecture : Sonar T [TRIGGER_PIN] E [ECHO_PIN]',
'zh-tw': 'HCSR超音波感測器,Echo在腳位[ECHO_PIN]Trig在腳位[TRIGGER_PIN]',
'zh-cn': 'HCSR超音波感测器,Echo在脚位[ECHO_PIN]Trig在脚位[TRIGGER_PIN]',
'pl': 'Odczytaj odległość: Sonar T [TRIGGER_PIN] E [ECHO_PIN]',
'ja': '超音波測距器からトリガ [TRIGGER_PIN] とエコー [ECHO_PIN] で入力',
};
// ESP-8266 specific
const FormIPBlockE = {
'pt-br': 'Endereço IP da placa ESP-8266 [IP_ADDR]',
'pt': 'Endereço IP da placa ESP-8266 [IP_ADDR]',
'en': 'ESP-8266 IP Address [IP_ADDR]',
'fr': "Adresse IP de l'ESP-8266 [IP_ADDR]",
'zh-tw': 'ESP-8266 IP 位址[IP_ADDR]',
'zh-cn': 'ESP-8266 IP 地址[IP_ADDR]',
'pl': 'Adres IP ESP-8266 [IP_ADDR]',
'ja': 'ESP-8266 の IP アドレスを [IP_ADDR] に',
};
// Raspbery Pi Specific
const FormIPBlockR = {
'pt-br': 'Endereço IP do RPi [IP_ADDR]',
'pt': 'Endereço IP do RPi [IP_ADDR]',
'en': 'Remote IP Address [IP_ADDR]',
'fr': 'Adresse IP du RPi [IP_ADDR]',
'zh-tw': '遠端 IP 位址[IP_ADDR]',
'zh-cn': '远程 IP 地址[IP_ADDR]',
'pl': 'Adres IP Rasberry Pi [IP_ADDR]',
'ja': 'ラズパイの IP アドレスを [IP_ADDR] に',
};
// General Alert
const FormWSClosed = {
'pt-br': "A Conexão do WebSocket está Fechada",
'pt': "A Conexão do WebSocket está Fechada",
'en': "WebSocket Connection Is Closed.",
'fr': "La connexion WebSocket est fermée.",
'zh-tw': "網路連線中斷",
'zh-cn': "网絡连线中断",
'pl': "Połączenie WebSocket jest zamknięte.",
'ja': "ウェブソケット接続が切断されています",
};
// ESP-8266 Alert
const FormAlrt = {
'pt-br': {
title: "Atenção",
text: "Informe o endereço IP da placa ESP-8266 no bloco apropriado",
icon: "info",
},
'pt': {
title: "Atenção",
text: "Informe o endereço IP da placa ESP-8266 no bloco apropriado",
icon: "info",
},
'en': {
title: "Reminder",
text: "Enter the IP Address of the ESP-8266 Into The IP Address Block",
icon: "info",
},
'fr': {
title: "Attention",
text: "Entrez l'adresse IP de l'ESP-8266 dans le bloc approprié.",
icon: "info",
},
'zh-tw': {
title: "提醒",
text: "請於 IP 位址積木中輸入 ESP-8266 的 IP 位址",
icon: "info",
},
'zh-cn': {
title: "提醒",
text: "请于 IP 位址积木中输入 ESP-8266 的 IP 地址",
icon: "info",
},
'pl': {
title: "Przypomnienie",
text: "Wprowadź adres IP ESP-8266 do bloku adresu IP",
icon: "info",
},
'ja': {
title: "注意",
text: "ESP-8266 の IP アドレスを IP アドレス・ブロックに記入して下さい",
icon: "info",
},
};
Hello Alan
when I command LED number 10 on the Playground Express...
the communication (error message on scratch) is switched off and LED D13 lights up.
My opinion:
When I turn on LED 1 it's the second LED that lights up.
then up to LED 9 everything is perfect.
but when the script accesses LED 10 it crashes.
can be an offset LED 0 => LED 9
LED 1 => LED 10 ?
thank you
framboise314
// General Alert
const FormWSClosed = {
'en': "WebSocket Connection Is Closed.",
'zh-tw': "硬體連線中斷",
'zh-cn': "硬件联机中断",
'pt-br': "A Conexão do WebSocket está Fechada",
'pt': "A Conexão do WebSocket está Fechada",
'fr': "Connexion WebSocket Fermée.",
'pl': "Połączenie WebSocket jest zamknięte.",
'ja': "ウェブソケット接続が切断されています",
};
const MENU_NON_BUTTON_SENSORS = {
'en': ["Slider", "Light", "Sound", "A", "B", "C", "D"],
'zh-tw': ["滑桿", "光線", "聲音", "A", "B", "C", "D"],
'zh-cn': ["滑杆", "光线", "声音", "A", "B", "C", "D"],
'pt-br': ["Controle deslizante", "Luz", "Som", "A", "B", "C", "D"],
'pt': ["Controle deslizante", "Luz", "Som", "A", "B", "C", "D"],
'fr': ["Glissière", "Lumière", "Son", "A", "B", "C", "D"],
'pl': ["Suwak", "Światło", "Dźwięk", "A", "B", "C", "D"],
'ja': ["つまみ位置", "光量", "音量", "A", "B", "C", "D"],
};
const MENU_ALL_SENSORS = {
'en': ["Slider", "Light", "Sound", "Button", "A", "B", "C", "D"],
'zh-tw': ["滑桿", "光線", "聲音", "按鈕", "A", "B", "C", "D"],
'zh-cn': ["滑杆", "光线", "声音", "按钮", "A", "B", "C", "D"],
'pt-br': ["Controle deslizante", "Luz", "Som", "Botão", "A", "B", "C", "D"],
'pt': ["Controle deslizante", "Luz", "Som", "Botão", "A", "B", "C", "D"],
'fr': ["Glissière", "Lumière", "Son", "Bouton", "A", "B", "C", "D"],
'pl': ["Suwak", "Światło", "Dźwięk", "Przycisk", "A", "B", "C", "D"],
'ja': ["つまみ位置", "光量", "音量", "ボタン状態", "A", "B", "C", "D"],
};
const MENU_COMPARISONS = {
'en': ['>', '<'],
'zh-tw': ['>', '<'],
'zh-cn': ['>', '<'],
'pt-br': ['>', '<'],
'pt': ['>', '<'],
'fr': ['>', '<'],
'pl': ['>', '<'],
'ja': ['>', '<'],
};
const MENU_BUTTON_STATES = {
'en': ["pressed", "released"],
'zh-tw': ["被按下", "被放開"],
'zh-cn': ["被按下", "被放开"],
'pt-br': ["pressionado", "liberado"],
'pt': ["pressionado", "liberado"],
'fr': ["appuyé", "relaché"],
'pl': ["wciśnięty", "zwolniony"],
'ja': ["押下", "解放"],
};
const FormBetween = {
'en': 'When [SENSOR] value is between [LOW] and [HIGH]',
'zh-tw': '當 [SENSOR] 的偵測值介於 [LOW] 與 [HIGH] 之間',
'zh-cn': '当 [SENSOR] 的侦测值介于 [LOW] 与 [HIGH] 之间',
'pt-br': 'Quando [SENSOR] estiver entre [LOW] e [HIGH]',
'pt': 'Quando [SENSOR] estiver entre [LOW] e [HIGH]',
'fr': 'Si la valeur de [SENSOR] est entre [LOW] et [HIGH]',
'pl': 'Kiedy wartość [SENSOR] jest pomiędzy [LOW] i [HIGH]',
'ja': '[SENSOR] が [LOW] と [HIGH] の間のとき',
};
const FormComparison = {
'en': 'When [SENSOR] [COMP] [VALUE].',
'zh-tw': '當 [SENSOR] 的偵測值 [COMP] [VALUE]',
'zh-cn': '当 [SENSOR] 的侦测值 [COMP] [VALUE]',
'pt-br': 'Quando [SENSOR] for [COMP] que [VALUE]',
'pt': 'Quando [SENSOR] for [COMP] que [VALUE]',
'fr': 'si [SENSOR] [COMP] [VALUE].',
'pl': 'Kiedy [SENSOR] [COMP] [VALUE].',
'ja': '[SENSOR] が [COMP] [VALUE] のとき',
};
const FormButton = {
'en': 'When Button [STATE].',
'zh-tw': '當按鈕 [STATE]',
'zh-cn': '当按钮 [STATE]',
'pt-br': 'Quando o botão estiver [STATE].',
'pt': 'Quando o botão estiver [STATE].',
'fr': 'Si Bouton [STATE].',
'pl': 'Kiedy przycisk jest [STATE].',
'ja': 'ボタン状態が [STATE] のとき',
};
const FormIsButtonPressed = {
'en': 'Is Button Pressed?',
'zh-tw': '按鈕被按下?',
'zh-cn': '按钮被按下?',
'pt-br': 'O botão está pressionado?',
'pt': 'O botão está pressionado?',
'fr': 'Bouton appuyé ?',
'pl': 'Czy przycisk jest wciśnięty?',
'ja': 'ボタン状態が押下か?',
};
const FormIsSensorComparison = {
'en': 'Is [SENSOR] [COMP] [VALUE] ?',
'zh-tw': '[SENSOR] 的偵測值 [COMP] [VALUE] ?',
'zh-cn': '[SENSOR] 的侦测值 [COMP] [VALUE] ?',
'pt-br': '[SENSOR] está [COMP] [VALUE] ?',
'pt': '[SENSOR] está [COMP] [VALUE] ?',
'fr': 'Est-ce que [SENSOR] [COMP] [VALUE] ?',
'pl': 'Czy [SENSOR] [COMP] [VALUE] ?',
'ja': '[SENSOR] が [COMP] [VALUE] か?',
};
const FormCurrentSensorValue = {
'en': '[SENSOR] current value.',
'zh-tw': '[SENSOR] 的偵測值',
'zh-cn': '[SENSOR] 的侦测值',
'pt': 'Ler valor atual: [SENSOR]',
'pt-br': 'Ler valor atual: [SENSOR]',
'fr': 'valeur actuelle de [SENSOR].',
'pl': 'Aktualna wartość [SENSOR].',
'ja': '[SENSOR] の現在値',
};
const FormRangeConverter = {
'en': 'Convert [SENSOR] value to a range of [RANGE1] to [RANGE2]',
'zh-tw': '轉換 [SENSOR] 的偵測值到 [RANGE1] 與 [RANGE2] 之間',
'zh-cn': '转换 [SENSOR] 的侦测值到 [RANGE1] 与 [RANGE2] 之间',
'pt-br': 'Converte valor: [SENSOR] para que fique entre [RANGE1] e [RANGE2]',
'pt': 'Converte valor: [SENSOR] para que fique entre [RANGE1] e [RANGE2]',
'fr': 'Convertir la valeur de [SENSOR] dans la plage [RANGE1] à [RANGE2]',
'pl': 'Przelicz wartość [SENSOR] do zakresu od [RANGE1] do [RANGE2]',
'ja': '[SENSOR] の値を [RANGE1] から [RANGE2] までの範囲に変更',
};
I've come across this problem when I'm trying to use Arduino Nano. I use Windows and can't just type s3a
to run the python code. Directly download your s3-extend code and run s3a.py also fail.
Hey
I put a Japanese translation for the extension "OneGpio Raspberry Pi Pico".
That is almost the same as one for "OneGpio Picoboard".
// General Alert
const FormWSClosed = {
'en': "WebSocket Connection Is Closed.",
'zh-tw': "硬體連線中斷",
'zh-cn': "硬件连接中断",
'pt-br': "A Conexão do WebSocket está Fechada",
'pt': "A Conexão do WebSocket está Fechada",
'fr': "Connexion WebSocket Fermée.",
'pl': "Połączenie WebSocket jest zamknięte.",
'ja': "ウェブソケット接続が切断されています",
};
const MENU_NON_BUTTON_SENSORS = {
'en': ["Slider", "Light", "Sound", "A", "B", "C", "D"],
'zh-tw': ["滑桿", "光線", "聲音", "A", "B", "C", "D"],
'zh-cn': ["滑杆", "光线", "声音", "A", "B", "C", "D"],
'pt-br': ["Controle deslizante", "Luz", "Som", "A", "B", "C", "D"],
'pt': ["Controle deslizante", "Luz", "Som", "A", "B", "C", "D"],
'fr': ["Glissière", "Lumière", "Son", "A", "B", "C", "D"],
'pl': ["Suwak", "Światło", "Dźwięk", "A", "B", "C", "D"],
'ja': ["つまみ位置", "光量", "音量", "A", "B", "C", "D"],
};
const MENU_ALL_SENSORS = {
'en': ["Slider", "Light", "Sound", "Button", "A", "B", "C", "D"],
'zh-tw': ["滑桿", "光線", "聲音", "按鈕", "A", "B", "C", "D"],
'zh-cn': ["滑杆", "光线", "声音", "按钮", "A", "B", "C", "D"],
'pt-br': ["Controle deslizante", "Luz", "Som", "Botão", "A", "B", "C", "D"],
'pt': ["Controle deslizante", "Luz", "Som", "Botão", "A", "B", "C", "D"],
'fr': ["Glissière", "Lumière", "Son", "Bouton", "A", "B", "C", "D"],
'pl': ["Suwak", "Światło", "Dźwięk", "Przycisk", "A", "B", "C", "D"],
'ja': ["つまみ位置", "光量", "音量", "ボタン状態", "A", "B", "C", "D"],
};
const MENU_COMPARISONS = {
'en': ['>', '<'],
'zh-tw': ['>', '<'],
'zh-cn': ['>', '<'],
'pt-br': ['>', '<'],
'pt': ['>', '<'],
'fr': ['>', '<'],
'pl': ['>', '<'],
'ja': ['>', '<'],
};
const MENU_BUTTON_STATES = {
'en': ["pressed", "released"],
'zh-tw': ["被按下", "被放開"],
'zh-cn': ["被按下", "被放开"],
'pt-br': ["pressionado", "liberado"],
'pt': ["pressionado", "liberado"],
'fr': ["appuyé", "relaché"],
'pl': ["wciśnięty", "zwolniony"],
'ja': ["押下", "解放"],
};
const FormBetween = {
'en': 'When [SENSOR] value is between [LOW] and [HIGH]',
'zh-tw': '當 [SENSOR] 的偵測值介於 [LOW] 與 [HIGH] 之間',
'zh-cn': '当 [SENSOR] 的检测值介于 [LOW] 与 [HIGH] 之间',
'pt-br': 'Quando [SENSOR] estiver entre [LOW] e [HIGH]',
'pt': 'Quando [SENSOR] estiver entre [LOW] e [HIGH]',
'fr': 'Si la valeur de [SENSOR] est entre [LOW] et [HIGH]',
'pl': 'Kiedy wartość [SENSOR] jest pomiędzy [LOW] i [HIGH]',
'ja': '[SENSOR] が [LOW] と [HIGH] の間のとき',
};
const FormComparison = {
'en': 'When [SENSOR] [COMP] [VALUE].',
'zh-tw': '當 [SENSOR] 的偵測值 [COMP] [VALUE]',
'zh-cn': '当 [SENSOR] 的检测值 [COMP] [VALUE]',
'pt-br': 'Quando [SENSOR] for [COMP] que [VALUE]',
'pt': 'Quando [SENSOR] for [COMP] que [VALUE]',
'fr': 'si [SENSOR] [COMP] [VALUE].',
'pl': 'Kiedy [SENSOR] [COMP] [VALUE].',
'ja': '[SENSOR] が [COMP] [VALUE] のとき',
};
const FormButton = {
'en': 'When Button [STATE].',
'zh-tw': '當按鈕 [STATE]',
'zh-cn': '当按钮 [STATE]',
'pt-br': 'Quando o botão estiver [STATE].',
'pt': 'Quando o botão estiver [STATE].',
'fr': 'Si Bouton [STATE].',
'pl': 'Kiedy przycisk jest [STATE].',
'ja': 'ボタン状態が [STATE] のとき',
};
const FormIsButtonPressed = {
'en': 'Is Button Pressed?',
'zh-tw': '按鈕被按下?',
'zh-cn': '按钮被按下?',
'pt-br': 'O botão está pressionado?',
'pt': 'O botão está pressionado?',
'fr': 'Bouton appuyé ?',
'pl': 'Czy przycisk jest wciśnięty?',
'ja': 'ボタン状態が押下か?',
};
const FormIsSensorComparison = {
'en': 'Is [SENSOR] [COMP] [VALUE] ?',
'zh-tw': '[SENSOR] 的偵測值 [COMP] [VALUE] ?',
'zh-cn': '[SENSOR] 的检测值 [COMP] [VALUE] ?',
'pt-br': '[SENSOR] está [COMP] [VALUE] ?',
'pt': '[SENSOR] está [COMP] [VALUE] ?',
'fr': 'Est-ce que [SENSOR] [COMP] [VALUE] ?',
'pl': 'Czy [SENSOR] [COMP] [VALUE] ?',
'ja': '[SENSOR] が [COMP] [VALUE] か?',
};
const FormCurrentSensorValue = {
'en': '[SENSOR] current value.',
'zh-tw': '[SENSOR] 的偵測值',
'zh-cn': '[SENSOR] 的检测值',
'pt': 'Ler valor atual: [SENSOR]',
'pt-br': 'Ler valor atual: [SENSOR]',
'fr': 'valeur actuelle de [SENSOR].',
'pl': 'Aktualna wartość [SENSOR].',
'ja': '[SENSOR] の現在値',
};
const FormRangeConverter = {
'en': 'Convert [SENSOR] value to a range of [RANGE1] to [RANGE2]',
'zh-tw': '轉換 [SENSOR] 的偵測值到 [RANGE1] 與 [RANGE2] 之間',
'zh-cn': '转换 [SENSOR] 的检测值到 [RANGE1] 与 [RANGE2] 之间',
'pt-br': 'Converte valor: [SENSOR] para que fique entre [RANGE1] e [RANGE2]',
'pt': 'Converte valor: [SENSOR] para que fique entre [RANGE1] e [RANGE2]',
'fr': 'Convertir la valeur de [SENSOR] dans la plage [RANGE1] à [RANGE2]',
'pl': 'Przelicz wartość [SENSOR] do zakresu od [RANGE1] do [RANGE2]',
'ja': '[SENSOR] の値を [RANGE1] から [RANGE2] までの範囲に変更',
};
If Arduino is connected to USB and Scratch 3 is working on it, OneGPIO fails to synch again when Arduino is plugged again to USB port. It also makes all the ports that were being used when unplugging USB to become instable and unusuable under Scratch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.