Skip to content

Commit

Permalink
More help docs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Dec 12, 2024
1 parent 840d30e commit 63d787c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/ml_on_event_stop.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For example, if your start event handler for an action starts music playing in t

## Example

This example uses the special `unknown` option and stops playing a musical melody when any other action has a certainty above the recognition point.
This example uses the special `unknown` option and stops playing a musical melody when the estimated action changes to any other action.

```blocks
ml.onStop(ml.event.Unknown, function () {
Expand Down
4 changes: 3 additions & 1 deletion docs/ml_on_event_stop_detailed.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ml.onStopDetailed(ml.event.Unknown, function (duration) {

When an action changes, the stop event handler for the previous action will run, followed by the start event handler for the next action.

For example, if your start event handler for an action starts music playing in the background, you could use a stop event handler to stop it.

The event handler is passed a `duration` parameter. The duration is the number of milliseconds since this action became the estimated action. You can use the duration parameter in your code, for example displaying it or using a variable to keep a running total.

## Parameters
Expand All @@ -18,7 +20,7 @@ The event handler is passed a `duration` parameter. The duration is the number o

## Example

This example uses the special `unknown` option and stops playing a musical melody when any other action has a certainty above the recognition point.
This example uses the special `unknown` option and shows the duration that `unknown` was the estimated action for in seconds when the estimated action changes to any other action.

```blocks
ml.onStopDetailed(ml.event.Unknown, function (duration) {
Expand Down

0 comments on commit 63d787c

Please sign in to comment.