2017-01-02 03:52:22 +01:00
|
|
|
# Getting started
|
|
|
|
|
|
|
|
### Step 1
|
|
|
|
|
2017-01-06 13:32:53 +01:00
|
|
|
Place blocks in the workspace to scroll text on the screen.
|
2017-01-02 03:52:22 +01:00
|
|
|
|
2017-01-06 13:32:53 +01:00
|
|
|
```blocks
|
2017-01-06 23:41:33 +01:00
|
|
|
basic.showString("Hello!")
|
2017-01-02 03:52:22 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
### Step 2
|
|
|
|
|
2017-01-06 23:41:33 +01:00
|
|
|
Click ``|Download|`` to transfer your code in your @boardname@!
|
2017-01-02 03:52:22 +01:00
|
|
|
|
|
|
|
### Step 3
|
|
|
|
|
2017-01-06 13:32:53 +01:00
|
|
|
Great, the text scrolled! But then it stopped.
|
|
|
|
Let's make it scroll when button **A** is pressed.
|
2017-01-02 03:52:22 +01:00
|
|
|
|
2017-01-04 19:06:47 +01:00
|
|
|
```block
|
2017-01-06 13:32:53 +01:00
|
|
|
input.onButtonPressed(Button.A, () => {
|
2017-01-06 23:41:33 +01:00
|
|
|
basic.showString("Hello!")
|
2017-01-06 13:32:53 +01:00
|
|
|
});
|
2017-01-02 03:52:22 +01:00
|
|
|
```
|
2017-01-06 13:32:53 +01:00
|
|
|
|
2017-01-02 03:52:22 +01:00
|
|
|
### Step 4
|
|
|
|
|
2017-01-06 23:41:33 +01:00
|
|
|
Click ``|Download|`` to transfer your code
|
|
|
|
and press **A** to scroll your text.
|
2017-01-06 13:32:53 +01:00
|
|
|
|
|
|
|
### Step 5
|
|
|
|
|
|
|
|
Place more blocks to display a smiley when button **B** is pressed.
|
2017-01-02 03:52:22 +01:00
|
|
|
|
2017-01-04 19:06:47 +01:00
|
|
|
```block
|
|
|
|
input.onButtonPressed(Button.B, () => {
|
|
|
|
basic.showLeds(`
|
2017-01-06 13:32:53 +01:00
|
|
|
# # . # #
|
|
|
|
# # . # #
|
2017-01-04 19:06:47 +01:00
|
|
|
. . . . .
|
2017-01-06 13:32:53 +01:00
|
|
|
# . . . #
|
|
|
|
. # # # .
|
2017-01-04 19:06:47 +01:00
|
|
|
`)
|
2017-01-03 07:14:40 +01:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
2017-01-06 13:32:53 +01:00
|
|
|
### Step 6
|
2017-01-02 03:52:22 +01:00
|
|
|
|
2017-01-06 13:32:53 +01:00
|
|
|
Drag more blocks to display a frownie when @boardname@ is shaken.
|
2017-01-02 03:52:22 +01:00
|
|
|
|
2017-01-04 19:06:47 +01:00
|
|
|
```block
|
2017-01-06 13:32:53 +01:00
|
|
|
input.onGesture(Gesture.Shake, () => {
|
|
|
|
basic.showLeds(`
|
|
|
|
# # . # #
|
|
|
|
# # . # #
|
|
|
|
. . . . .
|
|
|
|
. # # # .
|
|
|
|
# . . . #
|
|
|
|
`)
|
2017-01-03 07:14:40 +01:00
|
|
|
})
|
2017-01-02 03:52:22 +01:00
|
|
|
```
|