From 8abc137d602f70abfe4aef33b4abc382c2e34c5c Mon Sep 17 00:00:00 2001 From: Galen Nickel Date: Thu, 29 Mar 2018 16:43:17 -0700 Subject: [PATCH] Add 'showPorts' api doc (#392) --- docs/SUMMARY.md | 1 + docs/reference/brick.md | 1 + docs/reference/brick/show-ports.md | 24 ++++++++++++++++++++++++ libs/screen/targetoverrides.ts | 6 +++--- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 docs/reference/brick/show-ports.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index fef1fcba..d7146ef4 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -57,6 +57,7 @@ * [show mood](/reference/brick/show-mood) * [show image](/reference/brick/show-image) * [clear screen](/reference/brick/clear-screen) + * [show ports](/reference/brick/show-ports) * [on event](/reference/brick/button/on-event) * [is pressed](/reference/brick/button/is-pressed) * [was pressed](/reference/brick/button/was-pressed) diff --git a/docs/reference/brick.md b/docs/reference/brick.md index 269acaf9..645d703b 100644 --- a/docs/reference/brick.md +++ b/docs/reference/brick.md @@ -9,6 +9,7 @@ brick.showString("Hello world!", 1); brick.showNumber(0, 1); brick.showValue("item", 0, 1); brick.clearScreen(); +brick.showPorts(); ``` ## Buttons diff --git a/docs/reference/brick/show-ports.md b/docs/reference/brick/show-ports.md new file mode 100644 index 00000000..43c8b60f --- /dev/null +++ b/docs/reference/brick/show-ports.md @@ -0,0 +1,24 @@ +# show Ports + +Show the status of everything connected to the ports. + +```sig +brick.showPorts() +``` + +You can find out what's connected to the ports on the brick and show its status. The status information from each sensor or motor connected is displayed on the screen. + +## Example + +Show the status of the ports on the brick when the ``enter`` button is pressed. + +```blocks +brick.showString("Press ENTER for port status", 1) +brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { + brick.showPorts() +}) +``` + +## See also + +[show string](/reference/brick/show-string), [show value](/reference/brick/show-value) \ No newline at end of file diff --git a/libs/screen/targetoverrides.ts b/libs/screen/targetoverrides.ts index 01261443..f3bc3981 100644 --- a/libs/screen/targetoverrides.ts +++ b/libs/screen/targetoverrides.ts @@ -39,7 +39,7 @@ namespace brick { } /** - * Shows a number on the screen + * Show a number on the screen * @param value the numeric value * @param line the line number to print the text at, eg: 1 */ @@ -52,7 +52,7 @@ namespace brick { } /** - * Shows a name, value pair on the screen + * Show a name, value pair on the screen * @param value the numeric value * @param line the line number to print the text at, eg: 1 */ @@ -78,7 +78,7 @@ namespace brick { } /** - * Display the sensor and motor states attached to ports + * Display the status of the sensors and motors attached to ports */ //% blockId=brickShowPorts block="show ports" //% help=brick/show-ports blockGap=8