updated getting -started

This commit is contained in:
Peli de Halleux 2017-01-06 04:32:53 -08:00
parent 7fe8dad1f6
commit 05d88cb4ba

View File

@ -2,52 +2,66 @@
### Step 1 ### Step 1
Use the **Basic** drawer in the editor Place blocks in the workspace to scroll text on the screen.
to drag out and arrange three blocks to create this program:
```block ```blocks
basic.showString("Hello world") basic.showString("Hi!")
``` ```
### Step 2 ### Step 2
Use the **Basic** drawer in the editor Transfer your code in your @boardname@! Click the **Download** button
to drag out and arrange three blocks to create this program: and follow the instructions.
ANIMATEDGIF
### Step 3 ### Step 3
Use the **Basic** drawer in the editor Great, the text scrolled! But then it stopped.
to drag out and arrange three blocks to create this program: Let's make it scroll when button **A** is pressed.
```block ```block
basic.forever(() => { input.onButtonPressed(Button.A, () => {
basic.showNumber(0) basic.showString("Hi!")
}) });
``` ```
### Step 4 ### Step 4
Use the **Basic** drawer in the editor Transfer your code in your @boardname@ and try pressing **A**.
to drag out and arrange three blocks to create this program:
ANIMATEDGIF
### Step 5
Place more blocks to display a smiley when button **B** is pressed.
Download your code and try it!
```block ```block
input.onButtonPressed(Button.B, () => { input.onButtonPressed(Button.B, () => {
basic.showLeds(` basic.showLeds(`
# # . # #
# # . # #
. . . . . . . . . .
. . . . . # . . . #
. . . . . . # # # .
. . . . .
. . . . .
`) `)
}) })
``` ```
### Step 5 ### Step 6
Use the **Basic** drawer in the editor Drag more blocks to display a frownie when @boardname@ is shaken.
to drag out and arrange three blocks to create this program: Download your code and try it!
```block ```block
input.onButtonPressed(Button.A, () => { input.onGesture(Gesture.Shake, () => {
basic.showString("Hello!") basic.showLeds(`
# # . # #
# # . # #
. . . . .
. # # # .
# . . . #
`)
}) })
``` ```