Skip to content

Commit bb1ff21

Browse files
Switch to Spanish. Attempt real documentation
1 parent 42dee0a commit bb1ff21

File tree

8 files changed

+36
-35
lines changed

8 files changed

+36
-35
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mlrunner.customOnEvent": "ES - Register a TypeScript function to run when an event is raised.\n* This custom version of the MakeCode onEvent function is needed due to:\nhttps://github.com/microsoft/pxt-microbit/issues/5709\n*",
3+
"mlrunner.customOnEvent|param|flags": "ES - The specified event flags are ignored and configured via pxt.json.",
4+
"mlrunner.customOnEvent|param|handler": "ES - The function to call when the event is detected.",
5+
"mlrunner.customOnEvent|param|src": "ES - The ID of the component to listen to.",
6+
"mlrunner.customOnEvent|param|value": "ES - The event value to listen to from that component."
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"ml.event.Unknown|block": "ES - unknown",
3+
"ml.getCertainty|block": "ES - certainty (\\%) ML $event",
4+
"ml.isDetected|block": "ES - is ML $event detected",
5+
"ml.onStart|block": "ES - on ML $event start",
6+
"ml.onStopDetailed|block": "ES - on ML $event stop $duration (ms)",
7+
"ml.onStop|block": "ES - on ML $event stop",
8+
"mlrunner|block": "ES - mlrunner",
9+
"{id:category}Ml": "ES - Ml",
10+
"{id:category}MlEvent": "ES - MlEvent",
11+
"{id:category}Mlrunner": "ES - Mlrunner",
12+
"{id:group}micro:bit (V2)": "ES - micro:bit (V2)"
13+
}

_locales/fr/machine-learning-jsdoc-strings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

_locales/fr/machine-learning-strings.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/_locales/es/on-ml-start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# this is in Spanish!

docs/_locales/fr/on-ml-start.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/on-ml-start.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# file read
1+
# on ML start
22

3-
Reads the contents of a file from the file system
3+
Start an [event handler](https://makecode.microbit.org/---docs#doc:reference/event-handler) (part of the program that will run when something happens) This handler works when when the ML model’s estimated action changes to the action you select.
44

55
```sig
6-
files.read("/path/to/file.txt", "UTF-8")
6+
ml.onStart(ml.event.Unknown, function () {
7+
basic.showString("?")
8+
})
79
```
810

11+
The ML model updates its estimated action several times a second, but this block only runs when the estimated action changes.
12+
913
## Parameters
1014

11-
* **path**: a string that contains the path to the file on disk
12-
* **encoding**: the encoding of the file to be read
15+
- **action**: action one of the actions the machine learning model was trained on. The special value unknown represents the case where no action has a certainty above the recognition point.
1316

1417
## Example
1518

1619
This example reads from a file on disk and prints the contents to the console.
1720

1821
```blocks
19-
const contents = files.read("/path/to/file.txt", "UTF-8");
20-
console.log(contents)
22+
ml.onStart(ml.event.Unknown, function () {
23+
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Dadadadum), music.PlaybackMode.InBackground)
24+
})
2125
```
2226

23-
## See also
24-
* [write file](./write-file)
25-
2627
```package
2728
machine-learning=github:microbit-foundation/pxt-microbit-ml
28-
```
29+
```

pxt.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"pxtextension.ts",
1414
"pxtextension.cpp",
1515
"docs/on-ml-start.md",
16-
"docs/_locales/fr/on-ml-start.md",
17-
"_locales/fr/machine-learning-jsdoc-strings.json",
18-
"_locales/fr/machine-learning-strings.json"
16+
"docs/_locales/es/on-ml-start.md",
17+
"_locales/es/machine-learning-jsdoc-strings.json",
18+
"_locales/es/machine-learning-strings.json"
1919
],
2020
"testFiles": [
2121
"autogenerated.ts",

0 commit comments

Comments
 (0)