Add 'showPorts' api doc (#392)

This commit is contained in:
Galen Nickel
2018-03-29 16:43:17 -07:00
committed by Peli de Halleux
parent 3cad464ea5
commit 8abc137d60
4 changed files with 29 additions and 3 deletions

View File

@ -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)

View File

@ -9,6 +9,7 @@ brick.showString("Hello world!", 1);
brick.showNumber(0, 1);
brick.showValue("item", 0, 1);
brick.clearScreen();
brick.showPorts();
```
## Buttons

View File

@ -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)