pxt-calliope/docs/reference/basic/show-string.md

42 lines
1.0 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Show String
2016-04-13 17:27:45 +02:00
Show a string on the [LED screen](/device/screen) one character at a time (scrolling from left to right).
2016-03-26 00:47:20 +01:00
```sig
basic.showString("Hello!")
```
### Parameters
2016-04-13 17:27:45 +02:00
* `text` - a [String](/reference/types/string)
* (optional) `ms` - [Number](/reference/types/number); the time (in milliseconds) before scrolling left by one LED; the larger the number, the slower the scroll
2016-03-26 00:47:20 +01:00
### Examples:
To display Hello:
```blocks
basic.showString("Hello")
```
To display the content of a string variable:
```blocks
let s = "Hi"
basic.showString(s)
```
### Other show functions
2016-04-13 17:27:45 +02:00
* use [show number](/reference/basic/show-number) to show a number on the screen
* use [show animation](/reference/basic/show-animation) to show a series of images on the screen
2016-03-26 00:47:20 +01:00
### Lessons
2016-04-18 17:33:09 +02:00
[answering machine](/lessons/answering-machine), [rock paper scissors](/lessons/rock-paper-scissors), [love meter](/lessons/love-meter)
2016-03-26 00:47:20 +01:00
### See also
2016-04-16 01:15:08 +02:00
[String](/reference/types/string), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation)
2016-03-26 00:47:20 +01:00