-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Spanish. Attempt real documentation
- Loading branch information
1 parent
42dee0a
commit bb1ff21
Showing
8 changed files
with
36 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"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*", | ||
"mlrunner.customOnEvent|param|flags": "ES - The specified event flags are ignored and configured via pxt.json.", | ||
"mlrunner.customOnEvent|param|handler": "ES - The function to call when the event is detected.", | ||
"mlrunner.customOnEvent|param|src": "ES - The ID of the component to listen to.", | ||
"mlrunner.customOnEvent|param|value": "ES - The event value to listen to from that component." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"ml.event.Unknown|block": "ES - unknown", | ||
"ml.getCertainty|block": "ES - certainty (\\%) ML $event", | ||
"ml.isDetected|block": "ES - is ML $event detected", | ||
"ml.onStart|block": "ES - on ML $event start", | ||
"ml.onStopDetailed|block": "ES - on ML $event stop $duration (ms)", | ||
"ml.onStop|block": "ES - on ML $event stop", | ||
"mlrunner|block": "ES - mlrunner", | ||
"{id:category}Ml": "ES - Ml", | ||
"{id:category}MlEvent": "ES - MlEvent", | ||
"{id:category}Mlrunner": "ES - Mlrunner", | ||
"{id:group}micro:bit (V2)": "ES - micro:bit (V2)" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# this is in Spanish! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
# file read | ||
# on ML start | ||
|
||
Reads the contents of a file from the file system | ||
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. | ||
|
||
```sig | ||
files.read("/path/to/file.txt", "UTF-8") | ||
ml.onStart(ml.event.Unknown, function () { | ||
basic.showString("?") | ||
}) | ||
``` | ||
|
||
The ML model updates its estimated action several times a second, but this block only runs when the estimated action changes. | ||
|
||
## Parameters | ||
|
||
* **path**: a string that contains the path to the file on disk | ||
* **encoding**: the encoding of the file to be read | ||
- **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. | ||
|
||
## Example | ||
|
||
This example reads from a file on disk and prints the contents to the console. | ||
|
||
```blocks | ||
const contents = files.read("/path/to/file.txt", "UTF-8"); | ||
console.log(contents) | ||
ml.onStart(ml.event.Unknown, function () { | ||
music._playDefaultBackground(music.builtInPlayableMelody(Melodies.Dadadadum), music.PlaybackMode.InBackground) | ||
}) | ||
``` | ||
|
||
## See also | ||
* [write file](./write-file) | ||
|
||
```package | ||
machine-learning=github:microbit-foundation/pxt-microbit-ml | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters