Skip to content

Commit

Permalink
修正webserial microbit積木
Browse files Browse the repository at this point in the history
  • Loading branch information
estea8968 committed Oct 19, 2023
1 parent 11a2abd commit 62a270c
Show file tree
Hide file tree
Showing 15 changed files with 9,300 additions and 3,806 deletions.
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="google" value="notranslate">
<link rel="shortcut icon" href="static/favicon.ico">
<title>OSEP_scratch 1121013</title>
<title>OSEP_scratch 1121017</title>

</head>
<body>
<script type="text/javascript" src="lib.min.js"></script><script type="text/javascript" src="chunks/gui.js"></script> </body>
<script type="text/javascript" src="lib.min.js"></script><script type="text/javascript" src="chunks/gui.js"></script></body>
</html>
483 changes: 430 additions & 53 deletions app/lib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/lib.min.js.map

Large diffs are not rendered by default.

2,077 changes: 2,077 additions & 0 deletions app/static/microbit/77microbit_webserial_v1.hex

Large diffs are not rendered by default.

4,103 changes: 2,052 additions & 2,051 deletions app/static/microbit/microbit_webserial_v1.hex

Large diffs are not rendered by default.

4,405 changes: 2,706 additions & 1,699 deletions app/static/microbit/microbit_webserial_v2.hex

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions source/scratch-l10n/locales/editor-msgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -60548,6 +60548,7 @@ export default {
"gui.extension.tm2scratchblocks.description": "圖像與聲音辨識",
"gui.menuBar.burnFirmware_a":"燒錄Arduino",
"gui.menuBar.burnFirmware_e":"燒錄ESP",
"gui.menuBar.burnFirmware_m":"燒錄Microbit",
"gui.extension.linenotify.description":"Line通知,傳送訊息",
"gui.extension.microbitMore.description":"玩轉 micro:bit 的所有功能。(v2-0.2.4)",
"gui.extension.microbit.connectingMessage":"連線",
Expand Down
2 changes: 2 additions & 0 deletions source/scratch-vm/src/extension-support/extension-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const builtinExtensions = {
webserialEsp: () => require('../extensions/scratch3_webserialEsp8266'),
webserialEsp32: () => require('../extensions/scratch3_webserialEsp32'),
webserialPicoboard: () => require('../extensions/scratch3_webserialPicoboard'),
webserialmicrobit:() => require('../extensions/scratch3_webserialMicrobit'),
webserialLinkit7697: () => require('../extensions/scratch3_webserialLinkit7697'),
mqtt: () => require('../extensions/scratch3_mqtt'),
linenotify: () => require('../extensions/scratch3_linenotify'),
Expand All @@ -47,6 +48,7 @@ const builtinExtensions = {
tm2scratch: () => require('../extensions/scratch3_tm2scratch'),
microbitMore:() => require('../extensions/scratch3_microbitMore'),
openai: () => require('../extensions/scratch3_openai'),
googlebard: () => require('../extensions/scratch3_googlebard'),
facemesh2scratch:() => require('../extensions/scratch3_facemesh2scratch'),
handpose2scratch:() => require('../extensions/scratch3_handpose2scratch'),
dataMining:() => require('../extensions/scratch3_dataMining'),
Expand Down
1,251 changes: 1,251 additions & 0 deletions source/scratch-vm/src/extensions/scratch3_webserialMicrobit/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
export const w_content ={
'en': 'Contented micro:bit',
'zh-tw': '連線到micro:bit',
}
export const ledDisplayTextAry = {
'en': 'led display bmp [TEXT]',
'zh-tw': 'led顯示圖像[TEXT]',
};

export const analogRead ={
'en': 'analog pin [PIN] valume',
'zh-tw': '類比腳位[PIN]值',
};

export const digitalRead ={
'en': 'digital pin [PIN] valume',
'zh-tw': '數位腳位[PIN]值',
};

export const analogWrite ={
'en': 'PWM pin [PIN] output [VALUE]',
'zh-tw': 'PWM腳位[PIN]輸出[VALUE]',
};

export const digitalWrite ={
'en': 'digital pin [PIN] output [VALUE]',
'zh-tw': '數位腳位[PIN]輸出[VALUE]',
};

export const lightRead = {
'en': 'v2_temperature valume',
'zh-tw': 'v2_光線值',
};

export const radioRead = {
'en': 'v2_radio valume',
'zh-tw': 'v2_收到廣播值',
};

export const radioSend = {
'en': 'v2_radio send [TEXT]',
'zh-tw': 'v2_廣播送出[TEXT]',
};

export const isG248 ={
'en': 'v2_accelerometer [GXXX]',
'zh-tw': 'v2_加速度[GXXX]',
};

export const servoValue = {
'en': 'v2_servo at [PIN] angle[VALUE]',
'zh-tw': 'v2_[PIN]腳位伺服馬達角度[VALUE]',
};

export const FormTone = {
'en': 'v2_Tone [FREQ] Hz [DURATION] ms',
'zh-tw': 'v2_音調頻率為[FREQ]時間為[DURATION]毫秒',
};
export const tempRead = {
'en': 'v2_ ',
'zh-tw': 'v2_溫度',
};
export const mma8653Read={
'en': 'mma8653 [XYZ] valume',
'zh-tw': '三軸[XYZ]值',
};
export const mag3110Read={
'en': 'mag3110 [XYZ] valume',
'zh-tw': '磁感[XYZ]值',
};

export const tilt_direction_menu_ary={
'en': ['front','back','left','right','any'],
'zh-tw': ['向前','向後','向左','向右','任何']
};

export const ledDisplayLine ={
'en': 'LED line on x:[BX] y:[BY] ,to x:[EX] y:[EY]',
'zh-tw': 'x:[BX] y:[BY],到點x:[EX] y:[EY]亮燈'
};

export const displaydrawPixel = {
'en': 'x:[X] y:[Y] LED [ONOFF]',
'zh-tw': 'x:[X] y:[Y]亮熄[ONOFF]'
};

export const mag3110direct ={
'en': 'direction',
'zh-tw': '方向'
};

export const directEWSN ={
'en': ['east', 'northeast', 'north','northwest','west','southwest','south','southeast'],
'zh-tw': ['東', '東北', '北','西北','西','西南','南','東南']
};
56 changes: 56 additions & 0 deletions src/lib/libraries/extensions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ import webserialEsp32InsetIconURL from "./webserialEsp32/webserialEsp-small.png"

import webserialPicoboardImage from "./webserialPicoboard/webserialPicoboard.png";
import webserialPicoboardInsetIconURL from "./webserialPicoboard/webserialPicoboard-small.png";
import webserialmicrobitIconURL from "./webserialMicrobit/microbit.png";
import webserialmicrobitInsetIconURL from "./webserialMicrobit/microbit-small.svg";

import mqttImage from "./mqtt/mqtt.png";
import mqttInsetIconURL from "./mqtt/mqtt-small.png";
Expand Down Expand Up @@ -120,6 +122,9 @@ import webserialLinkit7697InsetIconURL from "./webserialLinkit7697/webserialLink
import openaiImage from "./openai/openai.png";
import openaiInsetIconURL from "./openai/openai-small.svg";

import googlebardImage from "./googlebard/googlebard.svg";
import googlebardInsetIconURL from "./googlebard/googlebard-small.svg";

import facemesh2scratchIconURL from "./facemesh2scratch/facemesh2scratch.png";
import facemesh2scratchInsetIconURL from "./facemesh2scratch/facemesh2scratch-small.png";
import handpose2scratchIconURL from "./handpose2scratch/handpose2scratch.png";
Expand Down Expand Up @@ -1065,6 +1070,57 @@ const extensions = [
useAutoScan: false,
helpLink: "https://openai.com/",
},
{
name: "webserialmicro:bit",
extensionId: "webserialmicrobit",
collaborator: "webserial micro:bit",
iconURL: webserialmicrobitIconURL,
insetIconURL: webserialmicrobitInsetIconURL,
description: (
<FormattedMessage
defaultMessage="Connect your projects with the world."
description="Description for the 'micro:bit' extension"
id="gui.extension.microbit.description"
/>
),
featured: true,
disabled: false,
//bluetoothRequired: true,
internetConnectionRequired: true,
launchPeripheralConnectionFlow: false,
useAutoScan: false,
connectionIconURL: microbitConnectionIconURL,
connectionSmallIconURL: microbitConnectionSmallIconURL,
connectingMessage: (
<FormattedMessage
defaultMessage="Connecting"
description="Message to help people connect to their micro:bit."
id="gui.extension.microbit.connectingMessage"
/>
),
//helpLink: "https://scratch.mit.edu/microbit",
},
/*{
name: "GoogleBard",
extensionId: "googlebard",
collaborator: "estea chen",
iconURL: googlebardImage,
insetIconURL: googlebardInsetIconURL,
description: (
<FormattedMessage
defaultMessage="Use Google Bard’s models to process natural language and generate images."
description="Use Google Bard’s models to process natural language and generate images."
id="gui.extension.googlebard.description"
/>
),
featured: true,
disabled: false,
// bluetoothRequired: false,
internetConnectionRequired: true,
// launchPeripheralConnectionFlow: false,
useAutoScan: false,
//helpLink: "https://openai.com/",
}*/
];
export { extensions };
export default extensions;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 62a270c

Please sign in to comment.